当前位置: 首页>>代码示例>>C#>>正文


C# NotImplementedException.ToString方法代码示例

本文整理汇总了C#中System.NotImplementedException.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# NotImplementedException.ToString方法的具体用法?C# NotImplementedException.ToString怎么用?C# NotImplementedException.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.NotImplementedException的用法示例。


在下文中一共展示了NotImplementedException.ToString方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: no_conversion_errors_but_the_action_blows_up

        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});
        }
开发者ID:storyteller,项目名称:Storyteller,代码行数:9,代码来源:LinePlanTester.cs

示例2: build_by_exception_and_message

        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";
        }
开发者ID:bobpace,项目名称:fubucore,代码行数:10,代码来源:ExceptionReportTester.cs

示例3: build_by_exception

        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";
        }
开发者ID:bobpace,项目名称:fubucore,代码行数:10,代码来源:ExceptionReportTester.cs

示例4: log_exception_logs_a_result

        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());
        }
开发者ID:storyteller,项目名称:Storyteller,代码行数:10,代码来源:SpecContextTester.cs

示例5: verify_any_blows_up

        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());
        }
开发者ID:sbartlett,项目名称:FubuMVC.Saml2,代码行数:11,代码来源:EnvironmentTestExtensionsTester.cs

示例6: verify_test_extensions_failure

        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);
        }
开发者ID:sbartlett,项目名称:FubuMVC.Saml2,代码行数:11,代码来源:EnvironmentTestExtensionsTester.cs

示例7: execute_sad_path

        public void execute_sad_path()
        {
            var context = new TestEnvelopeContext();
            var envelope = ObjectMother.Envelope();
            envelope.ExecutionTime = DateTime.Today;

            var exception = new NotImplementedException();
            envelope.Callback.Stub(x => x.MoveToDelayedUntil(envelope.ExecutionTime.Value)).Throw(exception);

            new DelayedEnvelopeHandler(SystemTime.Default()).Execute(envelope, context);

            envelope.Callback.AssertWasCalled(x => x.MarkFailed(exception));

            var report = context.RecordedLogs.ErrorMessages.Single().ShouldBeOfType<FubuCore.Logging.ExceptionReport>();
            report.CorrelationId.ShouldBe(envelope.CorrelationId);
            report.ExceptionText.ShouldBe(exception.ToString());
        }
开发者ID:cothienlac86,项目名称:fubumvc,代码行数:17,代码来源:DelayedEnvelopeHandlerTester.cs

示例8: ExceptionTypeMember

        public void ExceptionTypeMember()
        {
            var expression = "o";
            dynamic o = new ExpandoObject();
            var exception = new NotImplementedException();
            o.Member = exception;

            var type = new DkmClrType((TypeImpl)o.GetType());
            var value = CreateDkmClrValue((object)o, type);

            var result = FormatResult(expression, value);
            Verify(result,
                EvalResult(expression, "{System.Dynamic.ExpandoObject}", "System.Dynamic.ExpandoObject", expression, DkmEvaluationResultFlags.Expandable));
            var dynamicView = GetChildren(result).Last();
            Verify(dynamicView,
                EvalResult(Resources.DynamicView, Resources.DynamicViewValueWarning, "", "o, dynamic", DkmEvaluationResultFlags.Expandable | DkmEvaluationResultFlags.ReadOnly));
            Verify(GetChildren(dynamicView),
                EvalResult("Member", $"{{{exception.ToString()}}}", "System.NotImplementedException", "new Microsoft.CSharp.RuntimeBinder.DynamicMetaObjectProviderDebugView(o).Items[0]", DkmEvaluationResultFlags.ReadOnly));
        }
开发者ID:rahulchrty,项目名称:roslyn,代码行数:19,代码来源:DynamicViewTests.cs

示例9: read_a_fixture_failure

        public void read_a_fixture_failure()
        {
            var exception = new NotImplementedException();
            builder.LogFixtureFailure("bad fixture", exception);

            FixtureGraph fixture = builder.Library.FixtureFor("bad fixture");

            fixture.AllErrors().Count().ShouldEqual(1);

            GrammarError error = fixture.AllErrors().First();
            error.Message.ShouldEqual("Fixture 'bad fixture' could not be loaded");
            error.ErrorText.ShouldEqual(exception.ToString());
        }
开发者ID:adymitruk,项目名称:storyteller,代码行数:13,代码来源:LibraryBuilderTester.cs

示例10: reverting_a_fixture_with_an_exception_in_teardown_increments_exceptions_and_captures_the_exception

        public void reverting_a_fixture_with_an_exception_in_teardown_increments_exceptions_and_captures_the_exception()
        {
            var fixture = MockRepository.GenerateMock<IFixture>();
            var exception = new NotImplementedException();
            fixture.Expect(x => x.TearDown()).Throw(exception);

            var context = new TestContext();
            var section = new Section("something");

            context.LoadFixture(fixture, section);
            context.RevertFixture(section);

            context.ResultsFor(section).ExceptionText.ShouldEqual(exception.ToString());

            context.Counts.Exceptions.ShouldEqual(1);
        }
开发者ID:DarthFubuMVC,项目名称:storyteller,代码行数:16,代码来源:TestContextTester.cs

示例11: log_exception_from_section_setup

        public void log_exception_from_section_setup()
        {
            var fixture = MockRepository.GenerateMock<IFixture>();
            var context = new TestContext();

            var exception = new NotImplementedException();
            fixture.Expect(x => x.SetUp(context)).Throw(exception);

            var step = new Step();
            context.LoadFixture(fixture, step);

            context.Counts.Exceptions.ShouldEqual(1);
            context.ResultsFor(step).ExceptionText.ShouldContain(exception.ToString());
        }
开发者ID:DarthFubuMVC,项目名称:storyteller,代码行数:14,代码来源:TestContextTester.cs

示例12: Invoke

        /// <summary>
        /// Processes a request to determine if it matches a known file, and if so, serves it.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public Task Invoke(HttpContext context)
        {
            var fileContext = new StaticFileContext(context, _options, _matchUrl, _logger);

            if (!fileContext.ValidateMethod())
            {
                _logger.LogRequestMethodNotSupported(context.Request.Method);
            }
            else if (!fileContext.ValidatePath())
            {
                _logger.LogPathMismatch(fileContext.SubPath);
            }
            else if (!fileContext.LookupContentType())
            {
                _logger.LogFileTypeNotSupported(fileContext.SubPath);
            }
            else if (!fileContext.LookupFileInfo())
            {
                _logger.LogFileNotFound(fileContext.SubPath);
            }
            else
            {
                // If we get here, we can try to serve the file
                fileContext.ComprehendRequestHeaders();

                switch (fileContext.GetPreconditionState())
                {
                    case StaticFileContext.PreconditionState.Unspecified:
                    case StaticFileContext.PreconditionState.ShouldProcess:
                        if (fileContext.IsHeadMethod)
                        {
                            return fileContext.SendStatusAsync(Constants.Status200Ok);
                        }
                        if (fileContext.IsRangeRequest)
                        {
                            return fileContext.SendRangeAsync();
                        }

                        _logger.LogFileServed(fileContext.SubPath, fileContext.PhysicalPath);
                        return fileContext.SendAsync();

                    case StaticFileContext.PreconditionState.NotModified:
                        _logger.LogPathNotModified(fileContext.SubPath);
                        return fileContext.SendStatusAsync(Constants.Status304NotModified);

                    case StaticFileContext.PreconditionState.PreconditionFailed:
                        _logger.LogPreconditionFailed(fileContext.SubPath);
                        return fileContext.SendStatusAsync(Constants.Status412PreconditionFailed);

                    default:
                        var exception = new NotImplementedException(fileContext.GetPreconditionState().ToString());
                        Debug.Fail(exception.ToString());
                        throw exception;
                }
            }

            return _next(context);
        }
开发者ID:codehaks,项目名称:StaticFiles,代码行数:63,代码来源:StaticFileMiddleware.cs

示例13: track_and_fail

        public void track_and_fail()
        {
            var tracker = theStatusMonitor.TrackJob(3, new FooJob1());

            var ex = new NotImplementedException();
            tracker.Failure(ex);

            foo1.Status.ShouldBe(JobExecutionStatus.Failed);
            foo1.LastExecution.Executor.ShouldBe(theChannelGraph.NodeId);
            foo1.LastExecution.Success.ShouldBeFalse();
            foo1.LastExecution.Attempts.ShouldBe(3);
            foo1.LastExecution.ExceptionText.ShouldBe(ex.ToString());

            foo1.Executor.ShouldBeNull();

            thePersistence.FindHistory(foo1.NodeName, foo1.JobKey)
                .Single().ShouldBeTheSameAs(foo1.LastExecution);

            foo1.LastExecution.Executor.ShouldBe(theChannelGraph.NodeId);
        }
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:20,代码来源:ScheduledStatusMonitorTester.cs


注:本文中的System.NotImplementedException.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。