コード例 #1
0
 public void IgnoreAttributeWithUntilAddsIgnoreUntilDatePropertyPastUntilDate()
 {
     var ignoreAttribute = new IgnoreAttribute("BECAUSE");
     ignoreAttribute.Until = "1242-01-01";
     ignoreAttribute.ApplyToTest(test);
     Assert.That(test.Properties.Get(PropertyNames.IgnoreUntilDate), Is.EqualTo("1242-01-01 00:00:00Z"));
 }
コード例 #2
0
 public void IgnoreAttributeIgnoresTestUntilDateTimeSpecified()
 {
     var ignoreAttribute = new IgnoreAttribute("BECAUSE");
     ignoreAttribute.Until = "4242-01-01 12:00:00Z";
     ignoreAttribute.ApplyToTest(test);
     Assert.That(test.RunState, Is.EqualTo(RunState.Ignored));
 }
コード例 #3
0
 public void IgnoreAttributeWithInvalidDateThrowsException()
 {
     var ignoreAttribute = new IgnoreAttribute("BECAUSE");
     Assert.Throws<FormatException>(() => ignoreAttribute.Until = "Thursday the twenty fifth of December");
 }
コード例 #4
0
 public void IgnoreAttributeUntilSetsTheReason(string date)
 {
     var ignoreAttribute = new IgnoreAttribute("BECAUSE");
     ignoreAttribute.Until = date;
     ignoreAttribute.ApplyToTest(test);
     Assert.That(test.Properties.Get(PropertyNames.SkipReason), Is.EqualTo("Ignoring until 4242-01-01 00:00:00Z. BECAUSE"));
 }
コード例 #5
0
 public void IgnoreAttributeMarksTestAsRunnableAfterUntilDatePasses()
 {
     var ignoreAttribute = new IgnoreAttribute("BECAUSE");
     ignoreAttribute.Until = "1492-01-01";
     ignoreAttribute.ApplyToTest(test);
     Assert.That(test.RunState, Is.EqualTo(RunState.Runnable));
 }
コード例 #6
0
 public void IgnoreAttributeWithoutReasonSetsTheReason(string date, string reason)
 {
     var ignoreAttribute = new IgnoreAttribute();
     ignoreAttribute.Until = date;
     ignoreAttribute.ApplyToTest(test);
     Assert.That(test.Properties.Get(PropertyNames.SkipReason), Is.EqualTo("Ignoring until 4242-01-01 00:00:00Z"));
 }
コード例 #7
0
 public void IgnoreAttributeWithReasonDoesNotOverwriteTheReason()
 {
     var ignoreAttribute = new IgnoreAttribute("BECAUSE");
     ignoreAttribute.Until = "4242-01-01";
     ignoreAttribute.ApplyToTest(test);
     Assert.That(test.Properties.Get(PropertyNames.SkipReason), Is.EqualTo("BECAUSE"));
 }