public void ReqCustomParamAbsent() { Assert.Throws <ArgumentException>(() => InstancingHelper.CreateInstance <CustomParamsCtor>( _svcMgr, new InstancingCustomParam("messag", ""))); }
public void WrongCustomParam() { Assert.Throws <ArgumentException>(() => InstancingHelper.CreateInstance <MarkedDefaultCtor>( _svcMgr, new InstancingCustomParam("message", "", false))); }
public void CustomParams() { const string testMessage = "TestMessage"; var c = InstancingHelper.CreateInstance <CustomParamsCtor>( _svcMgr, new InstancingCustomParam("message", testMessage)); Assert.AreEqual(testMessage, c.Message); }
public void OnlyProviderParam() { Assert.AreEqual(_svcMgr, InstancingHelper.CreateInstance <OnlyProviderParam>(_svcMgr).Provider); }
public void NoPublicCtors() { Assert.Throws <ArgumentException>(() => InstancingHelper.CreateInstance <NoPublicCtors>(_svcMgr)); }
public void NoDefaultCtor() { Assert.Throws <ArgumentException>(() => InstancingHelper.CreateInstance <NoDefaultCtor>(_svcMgr)); }
public void MultipleDefaultCtors() { Assert.Throws <ArgumentException>(() => InstancingHelper.CreateInstance <MultipleDefaultCtors>(_svcMgr)); }
public void DefaultCtorMarkup() { Assert.AreEqual("default", InstancingHelper.CreateInstance <MarkedDefaultCtor>(_svcMgr).Message); }
public void OptionalCustomParam() { InstancingHelper.CreateInstance <MarkedDefaultCtor>( _svcMgr, new InstancingCustomParam("message", "", true)); }
public void NoCustomParam() { Assert.Throws <ArgumentException>(() => InstancingHelper.CreateInstance <CustomParamsCtor>(_svcMgr)); }