public async Task UpdateProjectSuccessfully() { var service = await GetInMemoryProjectService().ConfigureAwait(false); const int projectId = 2; const string projectName = "MTN Project"; const string projectCode = "MTN2020"; const string comment = "MTN Project created in 2020"; Projects project = new Projects() { ProjectId = projectId, ProjectName = projectName, ProjectCode = projectCode, Comment = comment }; var projectCreated = service.AddProject(new Proxy.Models.Project.Create { ProjectName = projectName, ProjectCode = projectCode, Comment = comment }); var result = service.GetAllProjects().First(); Proxy.Models.Project.Update model = new Proxy.Models.Project.Update { ProjectId = 2, ProjectName = "ProjectName", ProjectCode = "TD2021", Comment = "blah blah" }; var projectUpdated = service.Update(model); Assert.Equal(projectUpdated.ProjectId, model.ProjectId); Assert.Equal(projectUpdated.ProjectName, model.ProjectName); Assert.Equal(projectUpdated.ProjectCode, model.ProjectCode); Assert.Equal(projectUpdated.Comment, model.Comment); }
public void ItSetPropertyComment(string comment, Proxy.Models.Project.Update model) { model.Comment = comment; Assert.Equal(comment, model.Comment); }
public void ItSetPropertyProjectCode(string projectCode, Proxy.Models.Project.Update model) { model.ProjectCode = projectCode; Assert.Equal(projectCode, model.ProjectCode); }
public void ItSetPropertyProjects(int projectId, Proxy.Models.Project.Update model) { model.ProjectId = projectId; Assert.Equal(projectId, model.ProjectId); }