Exemplo n.º 1
0
 public void CanBeConstructedFromDerivedType_FromNonConstructableDerivedType_ReturnsFalse()
 {
     Assert.That(TypeConstruction.CanBeConstructedFromDerivedType <ConstructibleDerivedType>(), Is.False);
     Assert.That(TypeConstruction.CanBeConstructedFromDerivedType <NonConstructibleDerivedType>(), Is.False);
     Assert.That(TypeConstruction.CanBeConstructedFromDerivedType <NoConstructorType>(), Is.False);
     Assert.That(TypeConstruction.CanBeConstructedFromDerivedType <ParameterLessConstructorType>(), Is.False);
     Assert.That(TypeConstruction.CanBeConstructedFromDerivedType <ParameterConstructorType>(), Is.False);
     Assert.That(TypeConstruction.CanBeConstructedFromDerivedType <ScriptableObjectType>(), Is.False);
 }
Exemplo n.º 2
0
 public void CanBeConstructedTestsFromDerivedTypes()
 {
     Assert.That(TypeConstruction.CanBeConstructedFromDerivedType <IConstructInterface>(), Is.True);
     Assert.That(TypeConstruction.CanBeConstructedFromDerivedType <AbstractConstructibleBaseType>(), Is.True);
     Assert.That(TypeConstruction.CanBeConstructedFromDerivedType <ConstructibleBaseType>(), Is.True);
     Assert.That(TypeConstruction.CanBeConstructedFromDerivedType <ConstructibleDerivedType>(), Is.False);
     Assert.That(TypeConstruction.CanBeConstructedFromDerivedType <NonConstructibleDerivedType>(), Is.False);
     Assert.That(TypeConstruction.CanBeConstructedFromDerivedType <NoConstructorType>(), Is.False);
     Assert.That(TypeConstruction.CanBeConstructedFromDerivedType <ParameterLessConstructorType>(), Is.False);
     Assert.That(TypeConstruction.CanBeConstructedFromDerivedType <ParameterConstructorType>(), Is.False);
     Assert.That(TypeConstruction.CanBeConstructedFromDerivedType <ScriptableObjectType>(), Is.False);
 }
Exemplo n.º 3
0
 public void ConstructingAnInstance_DerivedFromObject_IsAlwaysPossible()
 {
     Assert.That(TypeConstruction.CanBeConstructedFromDerivedType <object>(), Is.True);
     Assert.That(TypeConstruction.Construct <object>(typeof(Types.A)), Is.Not.Null);
 }
Exemplo n.º 4
0
 public void CanBeConstructedFromDerivedType_FromConstructableDerivedType_ReturnsTrue()
 {
     Assert.That(TypeConstruction.CanBeConstructedFromDerivedType <IConstructInterface>(), Is.True);
     Assert.That(TypeConstruction.CanBeConstructedFromDerivedType <AbstractConstructibleBaseType>(), Is.True);
     Assert.That(TypeConstruction.CanBeConstructedFromDerivedType <ConstructibleBaseType>(), Is.True);
 }