public void CreateTest() { var mock = new Mock <IUnitOfWork>() { DefaultValue = DefaultValue.Mock }; var newSprint = new SprintDTO(); SprintService service = new SprintService(mock.Object); service.Create(newSprint); mock.Verify(i => i.Save()); }
public void GetSprintTest() { var mock = new Mock <IUnitOfWork>() { DefaultValue = DefaultValue.Mock }; var newSprint = new SprintDTO() { Name = "Name", Description = "Description", }; SprintService service = new SprintService(mock.Object); service.Create(newSprint); var result = service.GetByID(newSprint.Sprint_id); Assert.Equal(newSprint.Sprint_id, result.Sprint_id); Assert.NotStrictEqual(result.Name, newSprint.Name); Assert.NotStrictEqual(result.Description, newSprint.Description); }
public void UpdateTest() { var mock = new Mock <IUnitOfWork>() { DefaultValue = DefaultValue.Mock }; var newSprint = new SprintDTO() { Name = "Name", Description = "Description" }; SprintService service = new SprintService(mock.Object); service.Create(newSprint); newSprint.Name = "NameName"; newSprint.Description = "description"; service.Update(newSprint); var result = service.GetByID(newSprint.Sprint_id); Assert.Equal(result.Sprint_id, newSprint.Sprint_id); Assert.Equal("NameName", result.Name); Assert.Equal("description", result.Description); }