public void MapFrom_DoisTiposDiferentes()
        {
            var origin = new TestClass { Child = null, Id = Guid.NewGuid(), Number = 1, String = "oioi" };
            var destination = new TestOtherClass();

            destination.MapFrom(origin);

            Assert.AreEqual(origin.Id, destination.Id);
            Assert.AreEqual(origin.String, destination.String);
            Assert.AreNotEqual(origin.Number, destination.Number);
        }
Example #2
0
        public void MethodParameters_SpecifiedAsPropertyOfAnotherType_AreUserAsFilter()
        {
            var anotherType = new TestOtherClass();

            _interceptor.Method(p => p.MethodWithParam1(anotherType.BBB))
            .PrecededBy(() => _executionList.Add("Before"))
            .FollowedBy(() => _executionList.Add("After"));

            _proxyObject.MethodWithParam1("AAA");
            _proxyObject.MethodWithParam1("BBB");
            _proxyObject.MethodWithParam1("CCC");

            var expectedInvocations = new[] {
                "MethodWithParam1",
                "Before", "MethodWithParam1", "After",
                "MethodWithParam1"
            };

            CollectionAssert.AreEqual(expectedInvocations, _executionList);
        }