private void AssertUpdatedStep(DeployStep result, DeployStep original, string newStepName, string newTaskTypeName, string newTaskOptionsJson, string newSharedDeploymentStepId, string newUserName, IProjectRepository sut) { Assert.IsNotNull(result); Assert.IsNotNullOrEmpty(result.Id); Assert.AreEqual(original.ProjectId, result.ProjectId); Assert.AreEqual(original.ParentId, result.ParentId); Assert.AreEqual(original.ParentType, result.ParentType); Assert.AreEqual(newStepName, result.StepName); Assert.AreEqual(newTaskTypeName, result.TaskTypeName); Assert.AreEqual(newTaskOptionsJson, result.TaskOptionsJson); Assert.AreEqual(newSharedDeploymentStepId, result.SharedDeploymentStepId); Assert.AreEqual(original.CreatedByUserName, result.CreatedByUserName); AssertDateEqual(original.CreatedDateTimeUtc, result.CreatedDateTimeUtc); Assert.AreEqual(newUserName, result.UpdatedByUserName); AssertIsRecent(result.UpdatedDateTimeUtc); var dbItem = sut.GetComponentDeploymentStep(result.Id, result.ProjectId); AssertStep(result, dbItem); }
private void AssertCreatedStep(DeployStep result, DeployComponent component, string stepName, string taskTypeName, string taskOptionsJson, IProjectRepository sut) { Assert.IsNotNull(result); Assert.IsNotNullOrEmpty(result.Id); Assert.AreEqual(component.ProjectId, result.ProjectId); Assert.AreEqual(component.Id, result.ParentId); Assert.AreEqual(EnumDeployStepParentType.Component, result.ParentType); Assert.AreEqual(stepName, result.StepName); Assert.AreEqual(taskTypeName, result.TaskTypeName); Assert.AreEqual(taskOptionsJson, result.TaskOptionsJson); Assert.IsNotNullOrEmpty(result.SharedDeploymentStepId); Assert.AreEqual(this.UserName, result.CreatedByUserName); AssertIsRecent(result.CreatedDateTimeUtc); Assert.AreEqual(this.UserName, result.UpdatedByUserName); AssertIsRecent(result.UpdatedDateTimeUtc); var dbItem = sut.GetComponentDeploymentStep(result.Id, result.ProjectId); AssertStep(result, dbItem); }