public void Create_Returns_LinqToSqlUnitOfWork_Instance_When_DataContextProvider_Has_Been_Set() { Db4oUnitOfWorkFactory.SetContainerProvider(() => MockRepository.GenerateStub <IObjectContainer>()); var factory = new Db4oUnitOfWorkFactory(); var uowInstance = factory.Create(); Assert.That(uowInstance, Is.Not.Null); Assert.That(uowInstance, Is.TypeOf(typeof(Db4oUnitOfWork))); Db4oUnitOfWorkFactory.SetContainerProvider(null); }
public void Create_Returns_LinqToSqlUnitOfWork_Instance_When_DataContextProvider_Has_Been_Set() { Db4oUnitOfWorkFactory.SetContainerProvider(() => MockRepository.GenerateStub<IObjectContainer>()); var factory = new Db4oUnitOfWorkFactory(); var uowInstance = factory.Create(); Assert.That(uowInstance, Is.Not.Null); Assert.That(uowInstance, Is.TypeOf(typeof(Db4oUnitOfWork))); Db4oUnitOfWorkFactory.SetContainerProvider(null); }
public void Create_Throws_InvalidOperationException_When_No_ContainerProvider_Has_Been_Set() { var factory = new Db4oUnitOfWorkFactory(); Assert.Throws<InvalidOperationException>(() => factory.Create()); }
public void Create_Throws_InvalidOperationException_When_No_ContainerProvider_Has_Been_Set() { var factory = new Db4oUnitOfWorkFactory(); Assert.Throws <InvalidOperationException>(() => factory.Create()); }