コード例 #1
0
        public void VerifyTargetedViaAppender_WithOneTarget_DoesNotThrowException()
        {
            var appender = new ContextAppenderBuilder(TimeSpan.FromHours(1))
                           .PublicMessage()
                           .TargetedMessage();

            appender.VerifyTargeted(new List <string> {
                "#2"
            }.Select(i => new Civilian(i)));
        }
コード例 #2
0
        public void VerifyTargetedViaAppender_WithTwoTargetsButOneTooMany_ThrowsException()
        {
            var contextBuilder = new ContextAppenderBuilder(TimeSpan.FromHours(1))
                                 .PublicMessage()
                                 .TargetedMessage()
                                 .TargetedMessage();

            var exception = TestHelper.AssertCatch <Exception>(
                () => contextBuilder.VerifyTargeted(new List <string> {
                "#1", "#2", "#3"
            }.Select(i => new Civilian(i))));

            Assert.AreEqual("Expected targets are not equal to actual targets.", exception.Message);
        }