[Test] public void CheckIfNumberIsNegative() { int number = -10; Assert.IsFalse(number > 0, "Number should be negative"); }
[TestMethod] public void CheckIfNameIsEmpty() { string name = ""; Assert.IsFalse(string.IsNullOrEmpty(name), "Name should not be empty"); }This code checks if the variable name is null or empty and expects it to be false. If the condition is true, the test will fail and an appropriate message will be displayed.