コード例 #1
0
        public void ShouldAllowSpecifyingConstructorArgumentsNotTakenIntoAccountDuringValueBehaviorCheck()
        {
            XAssert.IsValue <ProperValueTypeWithOneArgumentIdentity>(
                ValueTypeTraits.Custom.SkipConstructorArgument(0));

            Assert.Throws <AssertionException>(XAssert.IsValue <ProperValueTypeWithOneArgumentIdentity>);
        }
コード例 #2
0
 public void ShouldAcceptProperFullValueTypesAndRejectBadOnes()
 {
     XAssert.IsValue <ProperValueType>();
     Assert.Throws <AssertionException>(XAssert.IsValue <ProperValueTypeWithoutEqualityOperator>);
 }
コード例 #3
0
 public void ShouldBeAbleToChooseInternalConstructorWhenThereisNoPublicOne()
 {
     Assert.DoesNotThrow(() => Any.Instance <FileNameWithoutExtension>());
     Assert.DoesNotThrow(() => XAssert.IsValue <FileNameWithoutExtension>());
 }
コード例 #4
0
 public void ShouldPassValueTypeAssertionForProperValueTypeWithInternalConstructor()
 {
     XAssert.IsValue <FileExtension>();
 }
コード例 #5
0
 public void ShouldPreferInternalNonRecursiveConstructorsToPublicRecursiveOnes()
 {
     Assert.DoesNotThrow(() => Any.Instance <DirectoryPath>());
     Assert.DoesNotThrow(() => XAssert.IsValue <DirectoryPath>());
 }
コード例 #6
0
 public void ShouldPassValueTypeAssertionForProperValueType()
 {
     XAssert.IsValue <ProperValueType>();
 }
コード例 #7
0
 public void ShouldWorkForPrimitves()
 {
     XAssert.IsValue <int>();
 }
コード例 #8
0
 public void ShouldWorkForStructuresWithDefaultEquality()
 {
     XAssert.IsValue <Maybe <string> >();
 }
コード例 #9
0
 public void ShouldBehaveLikeValue()
 {
     XAssert.IsValue <ChangedPath>();
 }
コード例 #10
0
 public static AndConstraint <TypeAssertions> BehaveLikeValue(this TypeAssertions o)
 {
     XAssert.IsValue(o.Subject);
     return(new AndConstraint <TypeAssertions>(o));
 }