public void CreateWithNullRepositoryWillThrow()
 {
     // Fixture setup
     var fixture = new RepositoryFixture();
     ProductRepository nullRepository = null;
     // Exercise system and verify outcome
     Assert.Throws<ArgumentNullException>(() =>
         fixture.Build<ProductService>()
             .FromFactory(() => new ProductService(nullRepository))
             .CreateAnonymous());
     // Teardown
 }
        public void CreateWithNullRepositoryWillThrow()
        {
            // Fixture setup
            var fixture = new RepositoryFixture();
            ProductRepository nullRepository = null;

            // Exercise system and verify outcome
            Assert.Throws <ArgumentNullException>(() =>
                                                  fixture.Build <ProductService>()
                                                  .FromFactory(() => new ProductService(nullRepository))
                                                  .CreateAnonymous());
            // Teardown
        }