Exemplo n.º 1
0
        public void MapperTest_Method_MethodSearch()
        {
            var fake   = new MapperMethodsFake();
            var mapper = new Mapper(fake);

            Assert.True(mapper.Properties.Count == 0);
            var method = mapper.Methods.Find(x => x.Member.Name == "SumTest");

            Assert.Equal("SumTest", method.Member.Name);
        }
Exemplo n.º 2
0
        public void MapperTest_Method_MethodParamaters_Return()
        {
            var fake   = new MapperMethodsFake();
            var mapper = new Mapper(fake);

            var method = mapper.Methods.Find(x => x.Member.Name == "SumTest");

            Assert.True(method.Parameters.Count == 2);
            Assert.True(method.Member.ReturnType == typeof(int));
            Assert.True(method.Parameters[0].ParameterType == typeof(int));
            Assert.True(method.Parameters[0].Name == "x");
            Assert.True(method.Parameters[1].ParameterType == typeof(int));
            Assert.True(method.Parameters[1].Name == "y");
        }
Exemplo n.º 3
0
        public void MapperTest_Method_MethodCount()
        {
            var fake   = new MapperMethodsFake();
            var mapper = new Mapper(fake);

            Assert.True(mapper.Properties.Count == 0);
            Assert.True(mapper.Methods.Count == 7);
            int count = 0;

            foreach (var method in mapper.Methods)
            {
                if (method.Member.DeclaringType == typeof(MapperMethodsFake))
                {
                    count++;
                }
            }
            Assert.True(count == 1);
        }