コード例 #1
0
 public void OperatorNotTypeShouldFailOnlyWhenTheValueHasType()
 {
     (~Pattern.Type <object, int>()).Match(1).IsSome.Should().BeFalse();
     (~Pattern.Type <object, string>()).Match("string").IsSome.Should().BeFalse();
     (~Pattern.Type <object, object>()).Match(null).IsSome.Should().BeTrue();
 }
コード例 #2
0
 public void TypeShouldSucceedOnlyWhenTheValueHasType()
 {
     Pattern.Type <object, int>().Match(1).IsSome.Should().BeTrue();
     Pattern.Type <object, string>().Match("string").IsSome.Should().BeTrue();
     Pattern.Type <object, object>().Match(null).IsSome.Should().BeFalse();
 }