Exemplo n.º 1
0
        public void Equals_TwoIdenticalInitializedObjects_ResultIsTrue()
        {
            // Arrange
            var object1 = new SystemPerformanceData
            {
                MemoryStatus = new SystemMemoryInformation {
                    AvailableMemoryInGB = 3
                },
                ProcessorStatus = new ProcessorUtilizationInformation {
                    ProcessorUtilizationInPercent = 30d
                }
            };

            var object2 = new SystemPerformanceData
            {
                MemoryStatus = new SystemMemoryInformation {
                    AvailableMemoryInGB = 3
                },
                ProcessorStatus = new ProcessorUtilizationInformation {
                    ProcessorUtilizationInPercent = 30d
                }
            };

            // Act
            bool result = object1.Equals(object2);

            // Assert
            Assert.IsTrue(result);
        }
Exemplo n.º 2
0
        public void Equals_TwoUninitializedObjects_ResultIsTrue()
        {
            // Arrange
            var object1 = new SystemPerformanceData();
            var object2 = new SystemPerformanceData();

            // Act
            bool result = object1.Equals(object2);

            // Assert
            Assert.IsTrue(result);
        }
Exemplo n.º 3
0
        public void Equals_SuppliedObjectIsOfOtherType_ResultIsFalse()
        {
            // Arrange
            var object1 = new SystemPerformanceData
            {
                MemoryStatus = new SystemMemoryInformation {
                    AvailableMemoryInGB = 3
                },
                ProcessorStatus = new ProcessorUtilizationInformation {
                    ProcessorUtilizationInPercent = 30d
                }
            };

            var object2 = new object();

            // Act
            bool result = object1.Equals(object2);

            // Assert
            Assert.IsFalse(result);
        }