namespace Base.Tests; [TestClass] public class ExpectingExceptions { /// /// Проверка метода на возврат исключения /// [ExpectedException(typeof(ArgumentNullException), "Exception was not throw")] [TestMethod] public void AssertMsTestExceptionTest() { var ms = new AssertMsTest(); ms.SayHello(null); } [TestMethod] public void AssertMsTestReturnTest() { var name = "Hi! Nikolay"; var ms = new AssertMsTest(); var actual = ms.SayHello("Nikolay"); Assert.AreEqual(name, actual, $"name: {name} act: {actual}"); } }