Esempio n. 1
0
        public void MappingCache2()
        {
            // Arrange
            var first = new First();
            var second = new Second();

            var map = MappingCache<First, Second>.Map;

            // Act
            var result = map(first, second);

            // Assert
            Assert.Equal(result.Second, second);
        }
Esempio n. 2
0
        public void MappingCache2_2()
        {
            // Arrange
            var first = new First();
            Second second = null;

            var map = MappingCache<First, Second>.Map;

            // Act
            var result = map(first, second);

            // Assert
            Assert.Null(result.Second);
        }
Esempio n. 3
0
        public void MappingCache4()
        {
            // Arrange
            var first = new First();
            var second = new Second();
            var third = new Third();
            var fourth = new Fourth();

            var map = MappingCache<First, Second, Third, Fourth>.Map;

            // Act
            var result = map(first, second, third, fourth);

            // Assert
            Assert.Equal(result.Second.Third.Fourth, fourth);
        }
Esempio n. 4
0
        public void MappingCache4_2()
        {
            // Arrange
            var first = new First();
            Second second = null;
            var third = new Third();
            var fourth = new Fourth();

            var map = MappingCache<First, Second, Third, Fourth>.Map;

            // Act
            var result = map(first, second, third, fourth);

            // Assert
            Assert.Null(result.Second);
        }