public void NullReturningInvalidCreateSUTTest() { var result = SpecRunner.Run <NullReturningInvalidCreateSUTSpec>(); Assert.Greater(result.FailedTests().Count(), 0); Assert.IsTrue(result.FailedTests().All(ft => ft.Message.StartsWith("System.InvalidOperationException") && ft.Message.Contains("Failed to construct SUT: ConstructSUT returned null")), "At least one failed spec reported an assertion error when it should have reported an exception."); }
public void RunSpecsAndCheckNames() { var result = SpecRunner.Run <SpecNamingSpec>(); var allTests = result.AllTests(); Assert.IsTrue(allTests.All(t => t.Name == SpecNamingSpec.ExpectedSpecName)); }
public void ExceptionsShouldTrumpAssertionErrors() { var result = SpecRunner.Run <BrokenClassSpec>(); Assert.Greater(result.FailedTests().Count(), 0, "Test cases should have failed"); Assert.IsTrue(result.FailedTests().All(ft => ft.Message.StartsWith("System.ArgumentOutOfRangeException")), "At least one failed spec reported an assertion error when it should have reported an exception."); }
public void ThrowSpecificExceptionForDuplicateGivenDescriptions() { var result = SpecRunner.Run <DuplicateDescriptionsSpec>(); Assert.Greater(result.FailedTests().Count(), 0, "Test cases should have failed"); Assert.IsTrue(result.FailedTests().All(ft => ft.Message.StartsWith(typeof(DuplicateDescriptionException).FullName)), "Every failure should have reported an exception specific to a description having been repeated"); Assert.IsTrue(result.FailedTests().All(ft => ft.StackTrace.Contains(typeof(DuplicateDescriptionsSpec).FullName)), "Every failure's stack trace should include a line number from the spec that failed"); }
public void ExceptionThrowingInvalidCreateSUTTest() { var result = SpecRunner.Run <ExceptionThrowingInvalidCreateSUTSpec>(); Assert.Greater(result.FailedTests().Count(), 0); Assert.IsTrue(result.FailedTests().All(ft => ft.Message.Equals( $"{ExceptionThrowingInvalidCreateSUTSpec.ConstructSUTThrownException.GetType().FullName} : {ExceptionThrowingInvalidCreateSUTSpec.ConstructSUTThrownException.Message}"))); }
public void run_st_spec() { using (var runner = new SpecRunner<NulloSystem>()) { var results = runner.Run("Linq Queries/DateTime querying"); runner.OpenResultsInBrowser(); } }
public void ExpectedExceptionExpectationFailureShouldFail() { var result = SpecRunner.Run <ExpectedExceptionExpectationFailureSpec>(); Assert.Greater(result.FailedTests().Count(), 0, "Test cases should have failed"); Assert.IsTrue(result.FailedTests().All(ft => ft.Message.StartsWith("System.Exception") && ft.Message.Contains("the specified constraint failed"))); }
public void run_st_spec() { using (var runner = new SpecRunner <NulloSystem>()) { var results = runner.Run("Event Store/Event Capture/Version a stream as part of event capture"); runner.OpenResultsInBrowser(); } }
public void run_st_spec() { using (var runner = new SpecRunner <NulloSystem>()) { var results = runner.Run("Event Store/Projections/Inline Aggregation by Stream"); runner.OpenResultsInBrowser(); } }
public void ExpectedExceptionNothingThrownShouldFail() { var result = SpecRunner.Run <ExpectedExceptionNothingThrownSpec>(); Assert.Greater(result.FailedTests().Count(), 0, "Test cases should have failed"); Assert.IsTrue(result.FailedTests().All(ft => ft.Message.StartsWith("System.Exception") && ft.Message.Contains("of type System.InvalidOperationException was not thrown") && ft.Message.Contains("no exception was thrown"))); }
public static void TryIt() { using (var runner = new SpecRunner <TestSystem>()) { //runner.Run("ServiceBus/HealthMonitoring/A running task goes down and gets reassigned"); runner.Run("ServiceBus/HealthMonitoring/Assign on order of preference when some nodes are down"); //runner.Run("ServiceBus/HealthMonitoring/Assign on order or preference when some nodes timeout on activation"); //runner.Run("ServiceBus/HealthMonitoring/A running task times out on health checks and gets reassigned"); runner.OpenResultsInBrowser(); } }
public void RunTransformations() { var runner = new SpecRunner<SpecificationSystem>(); var results = runner.Run("Docs/Navigation structure of a single directory using a splash page"); //var results = runner.Run("Docs/Transformation Rules"); //runner.RunAll(1.Minutes()); runner.OpenResultsInBrowser(); //results.Counts.AssertSuccess(); }
public void run_a_single_test() { using (var runner = new SpecRunner <TestSystem>()) { runner.Run("ServiceBus/Basics/Publishing a message that has multiple subscribers"); //runner.Run("ServiceBus/HealthMonitoring/A running task goes down and gets reassigned"); //runner.Run("ServiceBus/HealthMonitoring/Assign on order of preference when some nodes are down"); //runner.Run("ServiceBus/HealthMonitoring/Assign on order or preference when some nodes timeout on activation"); //runner.Run("ServiceBus/HealthMonitoring/A running task times out on health checks and gets reassigned"); runner.OpenResultsInBrowser(); } }