Exemplo n.º 1
0
 public void IsAssignableToType_WhenNotAssignableToType_ThrowsArgumentException() => AssertIsAssignableToTypeScenario(
     NonBogusType, BogusType,
     () => Ensure.Type.IsAssignableToType(typeof(Bogus), NonBogusType, ParamName),
     () => Ensure.Type.IsAssignableToType(new Bogus(), NonBogusType, ParamName),
     () => EnsureArg.IsAssignableToType(typeof(Bogus), NonBogusType, ParamName),
     () => EnsureArg.IsAssignableToType(new Bogus(), NonBogusType, ParamName),
     () => Ensure.ThatType(typeof(Bogus), ParamName).IsAssignableToType(NonBogusType),
     () => Ensure.ThatTypeFor(new Bogus(), ParamName).IsAssignableToType(NonBogusType));
Exemplo n.º 2
0
 public void IsAssignableToType_WhenAssignableToType_It_should_not_throw() => ShouldNotThrow(
     () => Ensure.Type.IsAssignableToType(NonBogusType, NonBogusType, ParamName),
     () => Ensure.Type.IsAssignableToType(new NonBogus(), NonBogusType, ParamName),
     () => EnsureArg.IsAssignableToType(NonBogusType, NonBogusType, ParamName),
     () => EnsureArg.IsAssignableToType(new NonBogus(), NonBogusType, ParamName),
     () => Ensure.ThatType(typeof(NonBogus), ParamName).IsAssignableToType(NonBogusType),
     () => Ensure.ThatTypeFor(new NonBogus(), ParamName).IsAssignableToType(NonBogusType),
     () => Ensure.Type.IsAssignableToType(AssignableToNonBogusType, NonBogusType, ParamName),
     () => Ensure.Type.IsAssignableToType(new AssignableToNonBogus(), NonBogusType, ParamName),
     () => EnsureArg.IsAssignableToType(AssignableToNonBogusType, NonBogusType, ParamName),
     () => EnsureArg.IsAssignableToType(new AssignableToNonBogus(), NonBogusType, ParamName),
     () => Ensure.ThatType(typeof(AssignableToNonBogus), ParamName).IsAssignableToType(NonBogusType),
     () => Ensure.ThatTypeFor(new AssignableToNonBogus(), ParamName).IsAssignableToType(NonBogusType));