Exemplo n.º 1
0
 public void ReqCustomParamAbsent()
 {
     Assert.Throws <ArgumentException>(() =>
                                       InstancingHelper.CreateInstance <CustomParamsCtor>(
                                           _svcMgr,
                                           new InstancingCustomParam("messag", "")));
 }
Exemplo n.º 2
0
 public void WrongCustomParam()
 {
     Assert.Throws <ArgumentException>(() =>
                                       InstancingHelper.CreateInstance <MarkedDefaultCtor>(
                                           _svcMgr,
                                           new InstancingCustomParam("message", "", false)));
 }
Exemplo n.º 3
0
        public void CustomParams()
        {
            const string testMessage = "TestMessage";
            var          c           = InstancingHelper.CreateInstance <CustomParamsCtor>(
                _svcMgr,
                new InstancingCustomParam("message", testMessage));

            Assert.AreEqual(testMessage, c.Message);
        }
Exemplo n.º 4
0
 public void OnlyProviderParam()
 {
     Assert.AreEqual(_svcMgr, InstancingHelper.CreateInstance <OnlyProviderParam>(_svcMgr).Provider);
 }
Exemplo n.º 5
0
 public void NoPublicCtors()
 {
     Assert.Throws <ArgumentException>(() => InstancingHelper.CreateInstance <NoPublicCtors>(_svcMgr));
 }
Exemplo n.º 6
0
 public void NoDefaultCtor()
 {
     Assert.Throws <ArgumentException>(() => InstancingHelper.CreateInstance <NoDefaultCtor>(_svcMgr));
 }
Exemplo n.º 7
0
 public void MultipleDefaultCtors()
 {
     Assert.Throws <ArgumentException>(() => InstancingHelper.CreateInstance <MultipleDefaultCtors>(_svcMgr));
 }
Exemplo n.º 8
0
 public void DefaultCtorMarkup()
 {
     Assert.AreEqual("default",
                     InstancingHelper.CreateInstance <MarkedDefaultCtor>(_svcMgr).Message);
 }
Exemplo n.º 9
0
 public void OptionalCustomParam()
 {
     InstancingHelper.CreateInstance <MarkedDefaultCtor>(
         _svcMgr,
         new InstancingCustomParam("message", "", true));
 }
Exemplo n.º 10
0
 public void NoCustomParam()
 {
     Assert.Throws <ArgumentException>(() => InstancingHelper.CreateInstance <CustomParamsCtor>(_svcMgr));
 }