public void ShouldFindDateTime_In_ClassWithDateTime_Today() { //Arrange DateTimeChecker dateTimeChecker = new DateTimeChecker(); Type classType = typeof(PrivateClassWrapper); string methodToTest = "System.Void ExampleClass.ClassWithDateTime::MethodWithDateTimeUtcNow()"; //Act IEnumerable<string> methodNames = dateTimeChecker.MethodsContainingDateTimeInAssemblyOfType(classType).ToList(); //Assert Assert.That(methodNames.Where(w => w == methodToTest), Is.Not.Empty); }
public void ShouldFindDateTime_In_ClassWithDateTime_Now() { //Arrange DateTimeChecker dateTimeChecker = new DateTimeChecker(); Type classType = typeof(ClassWithDateTime); string methodToTest = "System.Void ExampleClass.ClassWithDateTime::MethodWithDateTimeNow()"; String methodName = classType.GetMethods() .Single(w => w.Name.Contains(methodToTest)).Name; //Act IEnumerable<string> methodNames = dateTimeChecker.MethodsContainingDateTimeInAssemblyOfType(classType); //Assert Assert.That(methodNames.Where(w => w == methodName), Is.Not.Empty); }