public void UpdateNullMaterial() { var mock = new Mock <IMedalDao>(); mock.Setup(item => item.ShowById(It.IsAny <int>())).Returns( new Medal { Title = "GG", Material = "Gold" }); var logic = new MedalsLogic(mock.Object); mock.Setup(item => item.Update(It.IsAny <Medal>())); logic.Update(0, "GG", null); }
public void UpdateNullMaterial() { var mock = new Mock <IMedalDao>(); mock.Setup(item => item.GetById(It.IsAny <int>())).Returns( new Medal { Name = "For success...", Material = "Gold" }); var logic = new MedalsLogic(mock.Object); mock.Setup(item => item.Update(It.IsAny <int>(), It.IsAny <string>(), It.IsAny <string>())); logic.Update(0, "...", null); }
public void CorrectDataUpdating() { var mock = new Mock <IMedalDao>(); mock.Setup(item => item.ShowById(It.Is <int>(v => v == 7))).Returns( new Medal { Id = 7, Title = "GG", Material = "Gold" }); var logic = new MedalsLogic(mock.Object); mock.Setup(item => item.Update(It.IsAny <Medal>())); Assert.AreEqual(true, logic.Update(7, "GG", "Silver"), "Method Update doesn't work"); }