public void DefaultConstructorWorks()
 {
     var ex = new NotImplementedException();
     Assert.True((object)ex is NotImplementedException, "is NotImplementedException");
     Assert.AreEqual(ex.InnerException, null, "InnerException");
     Assert.AreEqual(ex.Message, "The method or operation is not implemented.");
 }
Ejemplo n.º 2
0
 public void TestChainTo()
 {
     var pipeline = SpatialImplementation.CurrentImplementation.CreateBuilder();
     var pipeline2 = SpatialImplementation.CurrentImplementation.CreateBuilder();
     var e = new NotImplementedException();
     SpatialTestUtils.VerifyExceptionThrown<NotImplementedException>(() => pipeline.ChainTo(pipeline2), e.Message);
 }
		public void ConstructorWithMessageAndInnerExceptionWorks() {
			var inner = new Exception("a");
			var ex = new NotImplementedException("The message", inner);
			Assert.IsTrue((object)ex is NotImplementedException, "is NotImplementedException");
			Assert.IsTrue(ReferenceEquals(ex.InnerException, inner), "InnerException");
			Assert.AreEqual(ex.Message, "The message");
		}
 public void ConstructorWithMessageWorks()
 {
     var ex = new NotImplementedException("The message");
     Assert.True((object)ex is NotImplementedException, "is NotImplementedException");
     Assert.AreEqual(ex.InnerException, null, "InnerException");
     Assert.AreEqual(ex.Message, "The message");
 }
 public void TypePropertiesAreCorrect()
 {
     Assert.AreEqual(typeof(NotImplementedException).GetClassName(), "Bridge.NotImplementedException", "Name");
     object d = new NotImplementedException();
     Assert.True(d is NotImplementedException, "is NotImplementedException");
     Assert.True(d is Exception, "is Exception");
 }
        public void moves_to_the_error_queue_if_the_exception_matches()
        {
            var handler = new MoveToErrorQueueHandler<NotImplementedException>();
            var ex = new NotImplementedException();

            handler.DetermineContinuation(null, ex).ShouldBeOfType<MoveToErrorQueue>()
                .Exception.ShouldBeTheSameAs(ex);
        }
        public void write_exception()
        {
            var ex = new NotImplementedException();

            writer.Exception(ex);

            writer.FailureCount.ShouldEqual(1);
        }
Ejemplo n.º 8
0
        public void BuildExceptionTitleUnhandledExceptionTest()
        {
            var innerEx = new NotImplementedException() { Source = "fakeInnerSource" };
            var ex = new System.Web.HttpUnhandledException("message", innerEx) { Source = "fakeSource" };

            var expected = "System.NotImplementedException - fakeInnerSource";
            Assert.AreEqual(expected, ExceptionsHelper.BuildExceptionTitle(ex));
        }
 public void ConstructingWithMessageAndInnerException()
 {
     Exception inner = new NotImplementedException();
       string message = "message";
       PluginSettingException ex = new PluginSettingException(message, inner);
       Assert.AreEqual(message, ex.Message);
       Assert.AreSame(inner, ex.InnerException);
 }
Ejemplo n.º 10
0
 public void BuildExceptionTitleInnerExceptionTest()
 {
     var innerEx = new NotImplementedException();
     var ex = new ArgumentNullException("message", innerEx) { Source = "fakeSource" };
     
     var expected = "System.ArgumentNullException - fakeSource";
     Assert.AreEqual(expected, ExceptionsHelper.BuildExceptionTitle(ex));
 }
Ejemplo n.º 11
0
        public void BuildExceptionStringInnerExceptionTest()
        {
            var innerEx = new NotImplementedException("fakeInnerMessage");
            var ex = new ArgumentNullException("fakeMessage", innerEx) { Source = "fakeSource" };

            var expected = "<strong>fakeMessage</strong><br /><br /><br /><br /><i><u>Inner Exception:</u></i><br /><strong>fakeInnerMessage</strong><br /><br />";
            Assert.AreEqual(expected, ExceptionsHelper.BuildExceptionString(ex));
        }
Ejemplo n.º 12
0
        public void BuildExceptionStringUnhandledExceptionTest()
        {
            var innerEx = new NotImplementedException("fakeMessage") { Source = "fakeInnerSource" };
            var ex = new System.Web.HttpUnhandledException("message", innerEx) { Source = "fakeSource" };

            var expected = "<strong>fakeMessage</strong><br /><br />";
            Assert.AreEqual(expected, ExceptionsHelper.BuildExceptionString(ex));
        }
Ejemplo n.º 13
0
        public void doesnt_Run_test_when_establish_context_fails()
        {
            var ex = new NotImplementedException();
            contextMock.Setup(x => x.Before()).Throws(ex);

            RunTest();

            testMock.Verify(x => x.Run(TestResult), Times.Never());
        }
Ejemplo n.º 14
0
        public void report_AfterFailure_if_excpetion_raished_during_cleanup()
        {
            var ex = new NotImplementedException();
            contextMock.Setup(x => x.After(TestResult)).Throws(ex);

            RunTest();

            testResultMock.Verify(x => x.AfterFailure(ex));
        }
Ejemplo n.º 15
0
        public void report_BeforeFailure_if_exception_raised_when_establishing_context()
        {
            var ex = new NotImplementedException();
            contextMock.Setup(x => x.Before()).Throws(ex);

            RunTest();

            testResultMock.Verify(x => x.BeforeFailure(ex));
        }
Ejemplo n.º 16
0
        public void no_conversion_errors_but_the_action_blows_up()
        {
            var ex = new NotImplementedException();
            theLineGrammar.Execute(values, context).Throws(ex);

            afterExecuting();

            context.AssertTheOnlyResultIs(new StepResult(values.id, ResultStatus.error){error = ex.ToString(), position = thePosition});
        }
Ejemplo n.º 17
0
        public void ExceptionTest()
        {
            var target = new ExecutionResult<String>();
            var expected = new NotImplementedException();
            target.Exception = expected;

            target.Exception.Should()
                  .BeSameAs( expected );
        }
			ReceiveCommand_When_exception_is_thrown_by_component_Then_exceptionHandler_calls_HandleException_instead_of_throwing()
		{
			var expectedException = new NotImplementedException();
			_inputProviderMock.Setup(x => x.GetLine()).Throws(expectedException);

			_application.ReadCommand();

			_exceptionHandlerMock.Verify(x => x.HandleException(expectedException), Times.Once);
		}
        static StackObject *Ctor_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *__ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new System.NotImplementedException();

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Ejemplo n.º 20
0
        public void build_by_exception_and_message()
        {
            var exception = new NotImplementedException("What?");

            var report = new ExceptionReport("Something went wrong!", exception);

            report.Message.ShouldEqual("Something went wrong!");
            report.ExceptionText.ShouldEqual(exception.ToString());
            report.ExceptionType = "NotImplementedException";
        }
Ejemplo n.º 21
0
        public void build_by_exception()
        {
            var exception = new NotImplementedException("What?");

            var report = new ExceptionReport(exception);

            report.Message.ShouldEqual(exception.Message);
            report.ExceptionText.ShouldEqual(exception.ToString());
            report.ExceptionType = "NotImplementedException";
        }
Ejemplo n.º 22
0
        public void no_conversion_errors_but_the_action_blows_up_sets_the_position()
        {
            var ex = new NotImplementedException();
            theLineGrammar.Execute(values, context).Throws(ex);

            afterExecuting();

            var result = context.Results.Single().ShouldBeOfType<StepResult>();
            result.position.ShouldBe(thePosition.ToString());
        }
        public void WriteExceptionTests()
        {
            var unthrownException = new NotImplementedException("Sample Exception Message");

            Assert.DoesNotThrow(() =>
            {
                _sut.Write(unthrownException);
                _sut.Write(unthrownException, _strCategory);
            });
        }
Ejemplo n.º 24
0
        public void log_exception_logs_a_result()
        {
            var exception = new NotImplementedException();
            theContext.LogException("1", exception, Stage.setup);

            var result = theContext.Results.Single().ShouldBeOfType<StepResult>();
            result.status.ShouldBe(ResultStatus.error);
            result.error.ShouldBe(exception.ToString());
            result.position.ShouldBe(Stage.setup.ToString());
        }
Ejemplo n.º 25
0
        public void is_successful_after_capturing_an_exception()
        {
            var correlation = new BehaviorFinish(new BehaviorCorrelation(new FakeNode()));

            var ex = new NotImplementedException("What?");
            correlation.LogException(ex);

            correlation.Succeeded.ShouldBeFalse();
            correlation.Exception.ShouldNotBeNull();
        }
Ejemplo n.º 26
0
 void ProcessNotImplementedException(StepExecutor stepExecutor, Step step, NotImplementedException ex)
 {
     step.EndTime = DateTime.Now;
     step.Outcome = Outcome.Failed;
     step.Reason = "Not Implemented";
     step.Exception = ex;
     if (scenario.Reason == null)
         scenario.Reason = "Step Not Implemented";
     statsCascader.CascadeStats(step, false);
     throw new StepNotImplementedException(step.Name, ex);
 }
		public void TypePropertiesAreCorrect() {
			Assert.AreEqual(typeof(NotImplementedException).FullName, "ss.NotImplementedException", "Name");
			Assert.IsTrue(typeof(NotImplementedException).IsClass, "IsClass");
			Assert.AreEqual(typeof(NotImplementedException).BaseType, typeof(Exception), "BaseType");
			object d = new NotImplementedException();
			Assert.IsTrue(d is NotImplementedException, "is NotImplementedException");
			Assert.IsTrue(d is Exception, "is Exception");

			var interfaces = typeof(NotImplementedException).GetInterfaces();
			Assert.AreEqual(interfaces.Length, 0, "Interfaces length");
		}
        public void verify_any_blows_up()
        {
            var exception = new NotImplementedException();
            theServices.Stub(x => x.GetInstance<EnvironmentTestExtensions.Holder<IFoo>>())
                       .Throw(exception);

            theServices.VerifyAnyRegistrations<IFoo>(theLog);

            theLog.Success.ShouldBeFalse();
            theLog.FullTraceText().ShouldContain(exception.ToString());
        }
        public void verify_test_extensions_failure()
        {
            var exception = new NotImplementedException();
            theServices.Stub(x => x.GetInstance<IFoo>()).Throw(exception);

            theServices.VerifyRegistration<IFoo>(theLog).ShouldBeNull();

            theLog.Success.ShouldBeFalse();
            theLog.FullTraceText().ShouldContain(exception.ToString());
            theLog.FullTraceText().ShouldContain("Could not resolve " + typeof(IFoo).FullName);
        }
Ejemplo n.º 30
0
        public void log_exception_captures_it_in_the_Exceptions_report()
        {
            var ex = new NotImplementedException("No go");

            theContext.Reporting.ReporterFor<ExceptionReport>().Count.ShouldBe(0);
            theContext.LogException("1", ex);

            theContext.Reporting.ReporterFor<ExceptionReport>().Count.ShouldBe(1);

            theContext.Reporting.ReporterFor<ExceptionReport>().ToHtml().ShouldContain("No go");
        }
Ejemplo n.º 31
0
        public void SetUp()
        {
            theEnvelope = ObjectMother.Envelope();
            theException = new NotImplementedException();

            theLogger = MockRepository.GenerateMock<ILogger>();

            theContext = new TestContinuationContext();

            new MoveToErrorQueue(theException).Execute(theEnvelope, theContext);
        }
        static StackObject *Ctor_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.String message = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = new System.NotImplementedException(message);

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Ejemplo n.º 33
0
        public async UnaryResult <Nil> GenerateException(string message)
        {
            var ex = new System.NotImplementedException();

            // dummy external operation.
            using (var activity = activitySource.StartActivity("db:errors/insert", ActivityKind.Internal))
            {
                // this is sample. use orm or any safe way.
                activity.SetTag("table", "errors");
                activity.SetTag("query", $"INSERT INTO rooms VALUES ('{ex.Message}', '{ex.StackTrace}');");
                await Task.Delay(TimeSpan.FromMilliseconds(2));
            }
            throw ex;
        }