public void ArgumentCountTest() { Assert.IsFalse(NineSlice.TryParse("_, _, _", out _), "TryParse returned true with 3 arguments."); Assert.ThrowsException <ArgumentException>(() => NineSlice.Parse("_, _, _"), $"Parse did not throw {nameof(ArgumentException)} with 3 arguments."); Assert.IsFalse(NineSlice.TryParse("_, _, _, _, _, _", out _), "TryParse returned true with 6 arguments."); Assert.ThrowsException <ArgumentException>(() => NineSlice.Parse("_, _, _, _, _, _"), $"Parse did not throw {nameof(ArgumentException)} with 6 arguments."); }
public void KeywordTest() { Assert.AreEqual(NineSlice.Thirds, NineSlice.Parse("Thirds"), "Thirds is not equal."); Assert.AreEqual(NineSlice.HSlice, NineSlice.Parse("HSlice"), "HSlice is not equal."); Assert.AreEqual(NineSlice.VSlice, NineSlice.Parse("VSlice"), "VSlice is not equal."); }
public void EmptyStringTest() { Assert.IsFalse(NineSlice.TryParse(string.Empty, out _), "TryParse returned true."); Assert.ThrowsException <ArgumentNullException>(() => NineSlice.Parse(string.Empty), $"Parse did not throw {nameof(ArgumentNullException)}."); }