Parameters
- instance
Library/Library.Test/TestFactories.cs
C# | Copy Code |
---|---|
TestObject obj = new TestObject(); IFactory<TestObject> factory = new InstanceFactory<TestObject>(obj); Assert.IsTrue(ReferenceEquals(obj, factory.Create())); Assert.IsTrue(ReferenceEquals(factory.Create(), factory.Create())); |
VB.NET | Copy Code |
---|---|
Dim obj As New TestObject() Dim factory As IFactory(Of TestObject) = New InstanceFactory(Of TestObject)(obj) Assert.IsTrue(ReferenceEquals(obj, factory.Create())) Assert.IsTrue(ReferenceEquals(factory.Create(), factory.Create())) |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7