Esempio n. 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");
        }
Esempio n. 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
        }
Esempio n. 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
        }