Exemple #1
0
        public void ShouldAllowSpecifyingConstructorArgumentsNotTakenIntoAccountDuringValueBehaviorCheck()
        {
            XAssert.IsValue <ProperValueTypeWithOneArgumentIdentity>(
                ValueTypeTraits.Custom.SkipConstructorArgument(0));

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