public static IoTEdgeReleaseEnvironment Create(VstsReleaseEnvironment vstsReleaseEnvironment) => new IoTEdgeReleaseEnvironment( vstsReleaseEnvironment.Id, vstsReleaseEnvironment.DefinitionId, vstsReleaseEnvironment.DefinitionName, vstsReleaseEnvironment.Status, vstsReleaseEnvironment?.Deployments?.Select(IoTEdgeReleaseDeployment.Create).ToHashSet() ?? new HashSet <IoTEdgeReleaseDeployment>());
public void TestCreate() { var vstsReleaseEnv = new VstsReleaseEnvironment { Id = 83429, DefinitionId = 2349080, Status = VstsEnvironmentStatus.Rejected }; IoTEdgeReleaseEnvironment releaseEnv = IoTEdgeReleaseEnvironment.Create(vstsReleaseEnv); Assert.AreEqual(83429, releaseEnv.Id); Assert.AreEqual(2349080, releaseEnv.DefinitionId); Assert.AreEqual(VstsEnvironmentStatus.Rejected, releaseEnv.Status); }
public static IoTEdgeReleaseEnvironment Create(VstsReleaseEnvironment vstsReleaseEnvironment) => new IoTEdgeReleaseEnvironment(vstsReleaseEnvironment.Id, vstsReleaseEnvironment.DefinitionId, vstsReleaseEnvironment.DefinitionName, vstsReleaseEnvironment.Status);