public void StrangeDate() { bool isWorking = false; try { MyAgeClass.DateCompar(DateTime.Now, DateTime.Now); } catch (AgeException ex) { if (ex.Message == "Автору 0 лет") { Console.WriteLine(ex.Message); isWorking = true; } } Assert.True(isWorking); }
public void NormDate() { Assert.Equal(new DateTime(19, 11, 4), MyAgeClass.DateCompar(new DateTime(2001, 2, 5), new DateTime(2019, 12, 9))); }