public void IsTypeOfWrongType() { Exception ex = Assert.Throws <ArgumentException>(() => ArgumentCheck.IsTypeOf <int>(typeof(Guid))); Assert.That(ex.Message, Is.StringContaining(typeof(int).FullName)); Assert.That(ex.Message, Is.StringContaining(typeof(Guid).FullName)); }
public void IsTypeOfChildType() { Exception ex = Assert.Throws <ArgumentException>(() => ArgumentCheck.IsTypeOf <ArgumentCheckUnitTests>(typeof(TestFixture))); Assert.That(ex.Message, Is.StringContaining(typeof(ArgumentCheckUnitTests).FullName)); Assert.That(ex.Message, Is.StringContaining(typeof(TestFixture).FullName)); }
public void IsTypeOfBaseClass() { Assert.DoesNotThrow(() => ArgumentCheck.IsTypeOf <TestFixture>(typeof(ArgumentCheckUnitTests))); }
public void IsTypeOfNull() { Assert.Throws <ArgumentNullException>(() => ArgumentCheck.IsTypeOf <TestFixture>(null)); }