public void EntityReferencesMightBeDisconnected() { CreatePartDoc(doc => { var feature = SpecHelper.InsertDummyBody(doc); var body = doc.GetBodiesTs().Single(); DisconnectEntity(doc, () => body); new Action(() => body.GetBodyBoxTs()).ShouldThrow <COMException>().Which.Message.Should().Contain("disconnected"); return(Disposable.Empty); }); }
public void PersistentEntityReferencesShouldNotBeDisconnected() { CreatePartDoc(doc => { var feature = SpecHelper.InsertDummyBody(doc); var body = doc.GetPersistentEntityReference(doc.GetBodiesTs().Single()); DisconnectEntity(doc, body); new Action(() => body().GetBodyBoxTs()).ShouldNotThrow <COMException>(); return(Disposable.Empty); }); }
public void GivenAWebFleetClient() { _mockHandler = new FakeHttpMessageHandler(request => { _httpRequest = request; return(FakeHttpMessageHandler.CreateResponse(HttpStatusCode.OK, new List <User> { new User { } })); }); _sut = SpecHelper.CreateClient(_mockHandler); }
/// <summary> /// Defines a test. All tests must be contained in at least 1 level of Describes. /// </summary> /// <param name="testDescription">The description of the test. The description should start with "should".</param> /// <param name="test">The implementation of the test.</param> /// <param name="sourceFile">Do not manually specify this parameter.</param> /// <param name="lineNumber">Do not manually specify this parameter.</param> public static void It(string testDescription, Action test, [CallerFilePath] string sourceFile = default, [CallerLineNumber] int lineNumber = default) { SpecHelper.RegisterTest(testDescription, test, false, false, sourceFile, lineNumber); }
/// <summary> /// Focuses the tests contained in this describe. All non-focused tests will /// be excluded from the test run. /// </summary> /// <param name="definition">The definition of the describe.</param> public static void fDescribe <TType>(Action definition) { SpecHelper.PushDescribe(typeof(TType).Name, true, false); definition(); SpecHelper.PopDescribe(); }
/// <summary> /// Focuses the tests contained in this describe. All non-focused tests will /// be excluded from the test run. /// </summary> /// <param name="childDescription">The description of the describe.</param> /// <param name="definition">The definition of the describe.</param> public static void fDescribe(string childDescription, Action definition) { SpecHelper.PushDescribe(childDescription, true, false); definition(); SpecHelper.PopDescribe(); }
/// <summary> /// Defines logic that will execute after each test. This can be used to clean up /// after a test or check some common expectations. The logic contained will only /// execute for tests in the current Describe context or any child Describe contexts. /// Before eaches can only be defined inside a Describe. /// </summary> /// <param name="afterEach">The logic to be executed.</param> public static void AfterEach(Func <Task> afterEach) { SpecHelper.AddAfterEach(afterEach); }
/// <summary> /// Describes a context for a test. This should usually be either a member name or /// a scenario whose tests are grouped together. /// </summary> /// <param name="description">The name of the member, the scenario description or similar.</param> /// <param name="definition">The definition of the describe.</param> public static void Describe(string description, Action definition) { SpecHelper.PushDescribe(description, false, false); definition(); SpecHelper.PopDescribe(); }
public void SpecHelper_CreateGenerator_Should_ReturnValidResult() { var result = SpecHelper.CreateGenerator(); result.Should().NotBeNull(); }
/// <summary> /// Defines logic that will execute after each test. This can be used to clean up /// after a test or check some common expectations. The logic contained will only /// execute for tests in the current Describe context or any child Describe contexts. /// Before eaches can only be defined inside a Describe. /// </summary> /// <param name="afterEach">The logic to be executed.</param> public static void AfterEach(Action afterEach) { SpecHelper.AddAfterEach(afterEach); }
public void ThenTheCorrectUrlIsInvoked() { var expectedUri = SpecHelper.CreateUri("showUsers", new ApiParameters()); Assert.That(_httpRequest.RequestUri, Is.EqualTo(expectedUri)); }
/// <summary> /// Defines logic that will execute before each test. This is used to initialise /// variables, spies and static values that are shared among multiple tests. The /// logic contained will only execute for tests in the current Describe context /// or any child Describe contexts. Before eaches can only be defined inside a /// Describe. /// </summary> /// <param name="beforeEach">The logic to be executed.</param> public static void BeforeEach(Action beforeEach) { SpecHelper.AddBeforeEach(beforeEach); }
/// <summary> /// Defines logic that will execute before each test. This is used to initialise /// variables, spies and static values that are shared among multiple tests. The /// logic contained will only execute for tests in the current Describe context /// or any child Describe contexts. Before eaches can only be defined inside a /// Describe. /// </summary> /// <param name="beforeEach">The logic to be executed.</param> public static void BeforeEach(Func <StringBuilder, Task> beforeEach) { SpecHelper.AddBeforeEach(beforeEach); }
/// <summary> /// Defines logic that will execute after each test. This can be used to clean up /// after a test or check some common expectations. The logic contained will only /// execute for tests in the current Describe context or any child Describe contexts. /// Before eaches can only be defined inside a Describe. /// </summary> /// <param name="afterEach">The logic to be executed.</param> public static void AfterEach(Action <StringBuilder> afterEach) { SpecHelper.AddAfterEach(afterEach); }
/// <summary> /// Defines logic that will execute before each test. This is used to initialise /// variables, spies and static values that are shared among multiple tests. The /// logic contained will only execute for tests in the current Describe context /// or any child Describe contexts. Before eaches can only be defined inside a /// Describe. /// </summary> /// <param name="beforeEach">The logic to be executed.</param> public static void BeforeEach(Action <StringBuilder> beforeEach) { SpecHelper.AddBeforeEach(beforeEach); }
/// <summary> /// Focuses the test. Any non-focused tests will be exlcuded from the test runs. /// </summary> /// <param name="testDescription">The description of the test. The description should start with "should".</param> /// <param name="test">The implementation of the test.</param> /// <param name="sourceFile">Do not manually specify this parameter.</param> /// <param name="lineNumber">Do not manually specify this parameter.</param> public static void fIt(string testDescription, Func <StringBuilder, Task> test, [CallerFilePath] string sourceFile = default, [CallerLineNumber] int lineNumber = default) { SpecHelper.RegisterTest(testDescription, test, true, false, sourceFile, lineNumber); }
public void SpecHelper_CreateXmlVsParser_Should_ReturnValidResult() { var result = SpecHelper.CreateXmlVsParser(); result.Should().NotBeNull(); }
public MarkDownReactor(IOutputWriter writer, IXmlContentReader xmlReader) { _builder = new MarkDownBuilder(SpecHelper.CreateGenerator(), SpecHelper.CreateXmlVsParser()); _writer = writer; _xmlReader = xmlReader; }
/// <summary> /// Defines logic that will execute before each test. This is used to initialise /// variables, spies and static values that are shared among multiple tests. The /// logic contained will only execute for tests in the current Describe context /// or any child Describe contexts. Before eaches can only be defined inside a /// Describe. /// </summary> /// <param name="beforeEach">The logic to be executed.</param> public static void BeforeEach(Func <Task> beforeEach) { SpecHelper.AddBeforeEach(beforeEach); }
/// <summary> /// Defines logic that will execute after each test. This can be used to clean up /// after a test or check some common expectations. The logic contained will only /// execute for tests in the current Describe context or any child Describe contexts. /// Before eaches can only be defined inside a Describe. /// </summary> /// <param name="afterEach">The logic to be executed.</param> public static void AfterEach(Func <StringBuilder, Task> afterEach) { SpecHelper.AddAfterEach(afterEach); }
public MarkDownReactor() { _builder = new MarkDownBuilder(SpecHelper.CreateGenerator(), SpecHelper.CreateXmlVsParser()); _writer = Forge.GetOutputWriter(); _xmlReader = Forge.GetXmlContentReader(); }