Пример #1
0
        public void TestMapping_ParameterLess_Method()
        {
            var methodElementsFinder = new FakeStaticMethodElementFinder(NewMethodName);
            var mapper = new StaticMethodMapper(_parentClass, methodElementsFinder);

            var mappedMethod     = mapper.GetMappedItem();
            var mappedMethodName = mappedMethod.Name;

            Assert.AreEqual(NewMethodName, mappedMethodName);
            Assert.IsTrue(mappedMethod.IsStatic);
            Assert.IsFalse(mappedMethod.HasInstancePointer());
        }
Пример #2
0
        public void StaticMethod_WithParameters_HasNotInstancePointer()
        {
            var methodElementsFinder =
                new FakeStaticMethodElementFinder(NewMethodName, new[] { InstancePointer, ParameterName });
            var mapper = new StaticMethodMapper(_parentClass, methodElementsFinder);

            var mappedMethod     = mapper.GetMappedItem();
            var mappedParameters = mappedMethod.Parameters.Select(a => a.Name).ToList();

            CollectionAssert.Contains(mappedParameters, ParameterName);
            CollectionAssert.Contains(mappedParameters, InstancePointer);

            Assert.IsFalse(mappedMethod.HasInstancePointer());
        }