コード例 #1
0
        public void getContext_short()
        {
            var exception = new CommandSyntaxException(Substitute.For <ICommandExceptionType>(), new LiteralMessage("error"), "Hello world!", 5);

            exception.Context.Should().BeEquivalentTo("Hello<--[HERE]");
        }
コード例 #2
0
        public void getContext_long()
        {
            var exception = new CommandSyntaxException(Substitute.For <ICommandExceptionType>(), new LiteralMessage("error"), "Hello world! This has an error in it. Oh dear!", 20);

            exception.Context.Should().BeEquivalentTo("...d! This ha<--[HERE]");
        }
コード例 #3
0
        public void getContext_none()
        {
            var exception = new CommandSyntaxException(Substitute.For <ICommandExceptionType>(), new LiteralMessage("error"));

            exception.Context.Should().BeNull();
        }