public void LastMappingCallSite_Test() { var callSite = new LastMappingCallSite(null, null, 1); Assert.Equal(2, callSite.Invoke(new object[] { "1", 2 })); Assert.Equal(ServiceLifetime.LastMapping, callSite.Lifetime); var t = typeof(LMCS_Class); callSite = new LastMappingCallSite(t, t.GetConstructors()[0].GetParameters()[0], 1); Assert.Throws<ArgumentException>(() => callSite.Invoke(null)); Assert.Throws<ArgumentException>(() => callSite.Invoke(new object[] { "1" })); }
public void LastMappingCallSite_Test() { var callSite = new LastMappingCallSite(null, null, 1); Assert.Equal(2, callSite.Invoke(new object[] { "1", 2 })); Assert.Equal(ServiceLifetime.LastMapping, callSite.Lifetime); var t = typeof(LMCS_Class); callSite = new LastMappingCallSite(t, t.GetConstructors()[0].GetParameters()[0], 1); Assert.Throws <ArgumentException>(() => callSite.Invoke(null)); Assert.Throws <ArgumentException>(() => callSite.Invoke(new object[] { "1" })); }