Exemplo n.º 1
0
        public void TestEquals()
        {
            var releaseEnv1 = new IoTEdgeReleaseEnvironment(3242, 343406, "Linux AMD64", VstsEnvironmentStatus.Queued);
            var releaseEnv2 = new IoTEdgeReleaseEnvironment(3242, 343406, "Linux AMD64", VstsEnvironmentStatus.Queued);
            var releaseEnv3 = new IoTEdgeReleaseEnvironment(9708, 343406, "Linux ARM64", VstsEnvironmentStatus.Queued);
            var releaseEnv4 = new IoTEdgeReleaseEnvironment(3242, 84893, "Windows X64", VstsEnvironmentStatus.Queued);
            var releaseEnv5 = new IoTEdgeReleaseEnvironment(3242, 343406, "Windows Server Core", VstsEnvironmentStatus.Succeeded);

            Assert.False(releaseEnv1.Equals(null));
            Assert.True(releaseEnv1.Equals(releaseEnv1));
            Assert.True(releaseEnv1.Equals(releaseEnv2));

            Assert.False(releaseEnv1.Equals((object)null));
            Assert.True(releaseEnv1.Equals((object)releaseEnv1));
            Assert.True(releaseEnv1.Equals((object)releaseEnv2));
            Assert.False(releaseEnv1.Equals(new object()));

            Assert.False(releaseEnv1.Equals(releaseEnv3));
            Assert.False(releaseEnv1.Equals(releaseEnv4));
            Assert.False(releaseEnv1.Equals(releaseEnv5));
        }
        public void TestEquals()
        {
            DateTime deploymentStartTime = DateTime.UtcNow;
            var      releaseEnv1         = new IoTEdgeReleaseEnvironment(3242, 343406, "Linux AMD64", VstsEnvironmentStatus.Queued, TestUtil.GetDeployments(1, deploymentStartTime));
            var      releaseEnv2         = new IoTEdgeReleaseEnvironment(3242, 343406, "Linux AMD64", VstsEnvironmentStatus.Queued, TestUtil.GetDeployments(1, deploymentStartTime));
            var      releaseEnv3         = new IoTEdgeReleaseEnvironment(9708, 343406, "Linux ARM64", VstsEnvironmentStatus.Queued, TestUtil.GetDeployments(1, deploymentStartTime));
            var      releaseEnv4         = new IoTEdgeReleaseEnvironment(3242, 84893, "Windows X64", VstsEnvironmentStatus.Queued, TestUtil.GetDeployments(1, deploymentStartTime));
            var      releaseEnv5         = new IoTEdgeReleaseEnvironment(3242, 343406, "Windows Server Core", VstsEnvironmentStatus.Succeeded, TestUtil.GetDeployments(1, deploymentStartTime));
            var      releaseEnv6         = new IoTEdgeReleaseEnvironment(3242, 343406, "Windows Server Core", VstsEnvironmentStatus.Succeeded, TestUtil.GetDeployments(2, deploymentStartTime));

            Assert.False(releaseEnv1.Equals(null));
            Assert.True(releaseEnv1.Equals(releaseEnv1));
            Assert.True(releaseEnv1.Equals(releaseEnv2));

            Assert.False(releaseEnv1.Equals((object)null));
            Assert.True(releaseEnv1.Equals((object)releaseEnv1));
            Assert.True(releaseEnv1.Equals((object)releaseEnv2));
            Assert.False(releaseEnv1.Equals(new object()));

            Assert.False(releaseEnv1.Equals(releaseEnv3));
            Assert.False(releaseEnv1.Equals(releaseEnv4));
            Assert.False(releaseEnv1.Equals(releaseEnv5));
            Assert.False(releaseEnv5.Equals(releaseEnv6));
        }