本文整理汇总了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});
}
示例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";
}
示例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";
}
示例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());
}
示例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());
}
示例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);
}
示例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());
}
示例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));
}
示例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());
}
示例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);
}
示例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());
}
示例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);
}
示例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);
}