示例#1
0
        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.");
        }
示例#2
0
        public void RunSpecsAndCheckNames()
        {
            var result   = SpecRunner.Run <SpecNamingSpec>();
            var allTests = result.AllTests();

            Assert.IsTrue(allTests.All(t => t.Name == SpecNamingSpec.ExpectedSpecName));
        }
示例#3
0
        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");
        }
示例#5
0
        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}")));
        }
示例#6
0
        public void run_st_spec()
        {
            using (var runner = new SpecRunner<NulloSystem>())
            {
                var results = runner.Run("Linq Queries/DateTime querying");

                runner.OpenResultsInBrowser();
            }
        }
示例#7
0
        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")));
        }
示例#8
0
        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();
            }
        }
示例#9
0
        public void run_st_spec()
        {
            using (var runner = new SpecRunner <NulloSystem>())
            {
                var results = runner.Run("Event Store/Projections/Inline Aggregation by Stream");


                runner.OpenResultsInBrowser();
            }
        }
示例#10
0
        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")));
        }
示例#11
0
 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();
     }
 }
示例#12
0
        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();
        }
示例#13
0
        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();
            }
        }