public void Ost() { functions f = new functions(); var ex = Assert.Throws <Exception>(() => f.Ost(5, 0)); Assert.That(ex.Message, Is.EqualTo("Значения должны быть > 0")); Assert.DoesNotThrow(() => f.Ost(5, 2)); }