Пример #1
0
 public void WarningFormatThrowsArgumentNullExceptionWhenFormatIsNull()
 {
     using (var template = new FakeTemplate())
     {
         template.Warning(null, null);
     }
 }
Пример #2
0
 public void WarningThrowsArgumentNullExceptionWhenMessageIsNull()
 {
     using (var template = new FakeTemplate())
     {
         template.Warning(null);
     }
 }
Пример #3
0
 public void TransformGeneratesOutputWhenValidateReportsWarnings()
 {
     using (var template = new FakeTemplate())
     {
         template.TransformedText = () => template.Write(TestOutput);
         template.Validated       = () => template.Warning(TestMessage);
         Assert.AreEqual(TestOutput, template.Transform());
     }
 }
Пример #4
0
 public void WarningFormatAddsNewWarningToErrorsCollection()
 {
     using (var template = new FakeTemplate())
     {
         template.Warning("{0}", TestMessage);
         Assert.AreEqual(1, template.Errors.Count);
         Assert.AreEqual(TestMessage, template.Errors[0].ErrorText);
         Assert.AreEqual(true, template.Errors[0].IsWarning);
     }
 }
Пример #5
0
 public void WarningFormatThrowsArgumentNullExceptionWhenFormatIsNull()
 {
     using (var template = new FakeTemplate())
     {
         template.Warning(null, null);                
     }
 }
Пример #6
0
 public void WarningFormatAddsNewWarningToErrorsCollection()
 {
     using (var template = new FakeTemplate())
     {
         template.Warning("{0}", TestMessage);
         Assert.AreEqual(1, template.Errors.Count);
         Assert.AreEqual(TestMessage, template.Errors[0].ErrorText);
         Assert.AreEqual(true, template.Errors[0].IsWarning);                
     }
 }
Пример #7
0
 public void WarningThrowsArgumentNullExceptionWhenMessageIsNull()
 {
     using (var template = new FakeTemplate())
     {
         template.Warning(null);                
     }
 }
Пример #8
0
 public void TransformGeneratesOutputWhenValidateReportsWarnings()
 {
     using (var template = new FakeTemplate())
     {
         template.TransformedText = () => template.Write(TestOutput);
         template.Validated = () => template.Warning(TestMessage);
         Assert.AreEqual(TestOutput, template.Transform());
     }
 }