コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
 public void IsTypeOfBaseClass()
 {
     Assert.DoesNotThrow(() => ArgumentCheck.IsTypeOf <TestFixture>(typeof(ArgumentCheckUnitTests)));
 }
コード例 #4
0
 public void IsTypeOfNull()
 {
     Assert.Throws <ArgumentNullException>(() => ArgumentCheck.IsTypeOf <TestFixture>(null));
 }