public void AddToolTolistTest() { //Arrange IToolstoreService toolstore = new ToolstoreService(); //Act Tool t1 = new Tool { Name = "KampBænk", Type = "Materialer", Brand = "Bonse", Price = 498 }; Tool t1copy = toolstore.AddTool(t1); //Arrange Assert.AreEqual(4, t1copy.Id); Assert.AreEqual("KampBænk", t1copy.Name); }
public void UpdateToolTest() { //Arrange IToolstoreService toolstore = new ToolstoreService(); //Act Tool t1 = new Tool { Name = "KampBænk2", Type = "Materialer", Brand = "Bonse", Price = 498 }; toolstore.AddTool(t1); t1.Name = "testUpdate"; Tool updatedTool = toolstore.UpdateTool(t1.Id.ToString(), t1); //Assert Assert.AreEqual("testUpdate", updatedTool.Name); }