Пример #1
0
        public void Compare_NullDeepComparisonService_ThrowsArgumentNullException()
        {
            // Arrange
            var scopedComparison = new ScopedComparison()
            {
                DeepComparisonService = null
            };

            // Act/Assert
            Assert.Throws <ArgumentNullException>(() => scopedComparison.Compare());
        }
Пример #2
0
        public void Compare_ValidDeepComparisonService_ReturnsResult()
        {
            // Arrange
            var mockComparisonService = new Mock <IDeepComparisonService>();

            mockComparisonService.Setup(m =>
                                        m.AreDeepEqual(It.IsAny <object>(), It.IsAny <object>(), It.IsAny <DeepComparisonOptions>()))
            .Returns(true);

            var scopedComparison = new ScopedComparison()
            {
                DeepComparisonService = mockComparisonService.Object
            };

            // Act
            var result = scopedComparison.Compare();

            // Assert
            Assert.True(result);
        }