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"); }
public void IsImplementingInterfaceTestNegativeInvalidOperationException() { ClassLevelAttribute attribute = new ClassLevelAttribute(); //attribute.TypeWorkingFor = typeof(string); attribute.IsImplementingInterface(typeof(IComparable)); //no assertion because the act must throw an exception }
public void IsImplementingInterfaceTestNegative() { ClassLevelAttribute attribute = new ClassLevelAttribute(); attribute.TypeWorkingFor = typeof(string); attribute.IsImplementingInterface(null); //no assertion because the act must throw an exception }