예제 #1
0
 public void it_should_throw_an_ArgumentNullException_when_the_key_is_null_for_the_type_specified()
 {
     using (var helper = new AutofacServiceLocatorHelper())
     {
         helper.ValidateKey(
             helper.AutofacServiceLocator.Invoking(x => x.Register((string)null, typeof(MyImplementation))));
         helper.ValidateKey(
             helper.AutofacServiceLocator.Invoking(x => x.Register(string.Empty, typeof(MyImplementation))));
         helper.ValidateKey(
             helper.AutofacServiceLocator.Invoking(x => x.Register(" ", typeof(MyImplementation))));
     }
 }
예제 #2
0
 it_should_throw_an_ArgumentNullException_when_the_key_specified_is_null_for_the_generic_contract_and_the_generic_type_specified
     ()
 {
     using (var helper = new AutofacServiceLocatorHelper())
     {
         helper.ValidateKey(
             helper.AutofacServiceLocator.Invoking(
                 x => x.Register <IMyTestingContract, MyImplementation>(null)));
         helper.ValidateKey(
             helper.AutofacServiceLocator.Invoking(
                 x => x.Register <IMyTestingContract, MyImplementation>(string.Empty)));
         helper.ValidateKey(
             helper.AutofacServiceLocator.Invoking(x => x.Register <IMyTestingContract, MyImplementation>(" ")));
     }
 }
 public void it_should_throw_an_ArgumentNullException_when_the_key_specified_is_null_for_the_generic_contract_and_the_generic_type_specified()
 {
     using (var helper = new AutofacServiceLocatorHelper())
     {
         helper.ValidateKey(
             helper.AutofacServiceLocator.Invoking(
                 x => x.Register<IMyTestingContract, MyImplementation>(null)));
         helper.ValidateKey(
             helper.AutofacServiceLocator.Invoking(
                 x => x.Register<IMyTestingContract, MyImplementation>(string.Empty)));
         helper.ValidateKey(
             helper.AutofacServiceLocator.Invoking(x => x.Register<IMyTestingContract, MyImplementation>(" ")));
     }
 }
 public void it_should_throw_an_ArgumentNullException_when_the_key_is_null_for_the_type_specified()
 {
     using (var helper = new AutofacServiceLocatorHelper())
     {
         helper.ValidateKey(
             helper.AutofacServiceLocator.Invoking(x => x.Register((string) null, typeof (MyImplementation))));
         helper.ValidateKey(
             helper.AutofacServiceLocator.Invoking(x => x.Register(string.Empty, typeof (MyImplementation))));
         helper.ValidateKey(
             helper.AutofacServiceLocator.Invoking(x => x.Register(" ", typeof (MyImplementation))));
     }
 }