public void OncePerRequestFactoryShouldCreateUniqueInstances() { var factory = new OncePerRequestFactory<ISerializable>(createInstance); ISerializable first = factory.CreateInstance(null); ISerializable second = factory.CreateInstance(null); // Both instances must be unique Assert.AreNotSame(first, second); Assert.IsNotNull(first); Assert.IsNotNull(second); }
public void OncePerRequestFactoryShouldCreateUniqueInstances() { var factory = new OncePerRequestFactory <ISerializable>(createInstance); ISerializable first = factory.CreateInstance(null); ISerializable second = factory.CreateInstance(null); // Both instances must be unique Assert.AreNotSame(first, second); Assert.IsNotNull(first); Assert.IsNotNull(second); }