public void ValidateFailEmptyNameTest() { string name = string.Empty; string command = "namesay"; { CowFileInfo uut = new CowFileInfo(); uut.CommandList[command] = name; Assert.Throws <ValidationException>(() => uut.Validate()); } name = null; { CowFileInfo uut = new CowFileInfo(); uut.CommandList[command] = name; Assert.Throws <ValidationException>(() => uut.Validate()); } name = " "; { CowFileInfo uut = new CowFileInfo(); uut.CommandList[command] = name; Assert.Throws <ValidationException>(() => uut.Validate()); } }
public void ValidateSuccessTest() { string name = "name"; string command = "namesay"; CowFileInfo uut = new CowFileInfo(); uut.CommandList[command] = name; Assert.DoesNotThrow(() => uut.Validate()); Assert.AreEqual(name, uut.CommandList[command]); }
public void CloneTest() { string name = "name"; string command = "namesay"; CowFileInfo uut1 = new CowFileInfo(); uut1.CommandList[command] = name; CowFileInfo uut2 = uut1.Clone(); Assert.AreNotSame(uut1, uut2); Assert.AreEqual(uut1.CommandList[command], uut2.CommandList[command]); }
public void ValidateFailEmptyCommandTest() { string name = "name"; string command = string.Empty; { CowFileInfo uut = new CowFileInfo(); uut.CommandList[command] = name; Assert.Throws <InvalidOperationException>(() => uut.Validate()); } command = " "; { CowFileInfo uut = new CowFileInfo(); uut.CommandList[command] = name; Assert.Throws <InvalidOperationException>(() => uut.Validate()); } }
public void ValidateFailEmptyList() { CowFileInfo uut = new CowFileInfo(); Assert.Throws <ValidationException>(() => uut.Validate()); }