How to use child_class_is_level_2 method of NSpec.Tests.WhenRunningSpecs.parent_context class

Best NSpec code snippet using NSpec.Tests.WhenRunningSpecs.parent_context.child_class_is_level_2

Run NSpec automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

describe_levels_inheritance.cs

Source: describe_levels_inheritance.cs Github

copy
1using FluentAssertions;
2using NUnit.Framework;
3
4namespace NSpec.Tests.WhenRunningSpecs
5{
6    public class describe_levels_inheritance : when_running_specs
7    {
8        class parent_context : nspec { }
9
10        class child_context : parent_context
11        {
12            void it_is()
13            {
14                Assert.That("is", Is.EqualTo("is"));
15            }
16        }
17
18        [SetUp]
19        public void Setup()
20        {
21            Run(new[] { typeof(parent_context), typeof(child_context) });
22        }
23
24        [Test]
25        public void parent_class_is_level_1()
26        {
27            TheContext("parent context").Level.Should().Be(1);
28        }
29
30        [Test]
31        public void child_class_is_level_2()
32        {
33            TheContext("child context").Level.Should().Be(2);
34        }
35    }
36}
Full Screen

Accelerate Your Automation Test Cycles With LambdaTest

Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.

Try LambdaTest

Most used method in parent_context

Trigger child_class_is_level_2 code on LambdaTest Cloud Grid

Execute automation tests with child_class_is_level_2 on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free
LambdaTestX

We use cookies to give you the best experience. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. Learn More in our Cookies policy, Privacy & Terms of service

Allow Cookie
Sarah

I hope you find the best code examples for your project.

If you want to accelerate automated browser testing, try LambdaTest. Your first 100 automation testing minutes are FREE.

Sarah Elson (Product & Growth Lead)