public void TestMapping_ParameterLess_Method() { var methodElementsFinder = new FakeInstanceMethodElementFinder(NewMethodName, new[] { InstancePointer }); var mapper = new InstanceMethodMapper(_parentClass, methodElementsFinder); var mappedMethod = mapper.GetMappedItem(); var mappedMethodName = mappedMethod.Name; Assert.AreEqual(NewMethodName, mappedMethodName); Assert.IsFalse(mappedMethod.IsStatic); Assert.IsTrue(mappedMethod.HasInstancePointer()); }
public void TestMapping_Method_WithParameters() { var methodElementsFinder = new FakeInstanceMethodElementFinder(NewMethodName, new[] { InstancePointer, ParameterName }); var mapper = new InstanceMethodMapper(_parentClass, methodElementsFinder); var mappedMethod = mapper.GetMappedItem(); var mappedParameters = mappedMethod.Parameters.Select(a => a.Name).ToList(); var mappedInstancePointer = mappedMethod.InstancePointer.Name; CollectionAssert.Contains(mappedParameters, ParameterName); CollectionAssert.DoesNotContain(mappedParameters, InstancePointer); Assert.AreEqual(InstancePointer, mappedInstancePointer); }