示例#1
0
        public void IsImplementingInterfaceTestPositiv()
        {
            //Arrange
            ClassLevelAttribute attribute = new ClassLevelAttribute
            {
                TypeWorkingFor = typeof(string)
            };

            Assert.IsTrue(attribute.IsImplementingInterface(typeof(IComparable)), "Type string does not implement IComparable");

            Assert.IsFalse(attribute.IsImplementingInterface(typeof(IDisposable)), "Type does implement IDisposable");
        }
示例#2
0
        public void IsImplementingInterfaceTestNegativeInvalidOperationException()
        {
            ClassLevelAttribute attribute = new ClassLevelAttribute();

            //attribute.TypeWorkingFor = typeof(string);

            attribute.IsImplementingInterface(typeof(IComparable));

            //no assertion because the act must throw an exception
        }
示例#3
0
        public void IsImplementingInterfaceTestNegative()
        {
            ClassLevelAttribute attribute = new ClassLevelAttribute();

            attribute.TypeWorkingFor = typeof(string);

            attribute.IsImplementingInterface(null);

            //no assertion because the act must throw an exception
        }