public Mock <T> BuiltObject <T>(ObjectBuilderType builderType, string connectionId) where T : XenObject <T> { MockObjectBuilder builder = Builder(builderType, connectionId); if (builder.MockedType == typeof(T)) { return(builder.BuildObject() as Mock <T>); } throw new ArgumentException("Type mismatch between template and builder output"); }
public MockObjectBuilder Builder(ObjectBuilderType builderType, string connectionId) { MockObjectBuilder builder = null; switch (builderType) { case ObjectBuilderType.VmWithHomeServerHost: builder = new MockVmWithHomeServer(objectManager, connectionId); break; case ObjectBuilderType.VdiWithVbds: builder = new MockVdiWithVbds(objectManager, connectionId); break; case ObjectBuilderType.ClearwaterHost: builder = new MockVersionedHost(objectManager, connectionId, ClearwaterPlatformVersion, ClearwaterProductVersion); break; case ObjectBuilderType.TampaHost: builder = new MockVersionedHost(objectManager, connectionId, "1.6.10", "6.1.0"); break; case ObjectBuilderType.SanibelHost: builder = new MockVersionedHost(objectManager, connectionId, "1.0.99", "6.0.2"); break; case ObjectBuilderType.BostonHost: builder = new MockVersionedHost(objectManager, connectionId, "1.0.99", "6.0.0"); break; case ObjectBuilderType.CowleyHost: builder = new MockVersionedHost(objectManager, connectionId, String.Empty, "5.6.100"); break; case ObjectBuilderType.FloodgateHost: case ObjectBuilderType.OrlandoHost: builder = new MockVersionedHost(objectManager, connectionId, String.Empty, "5.0.0"); break; case ObjectBuilderType.RioHost: builder = new MockVersionedHost(objectManager, connectionId, String.Empty, "4.0.0"); break; case ObjectBuilderType.PoolOfTwoClearwaterHosts: builder = new MockPoolOfVersionedHosts(objectManager, connectionId, ClearwaterPlatformVersion, ClearwaterProductVersion, 2); break; } return(builder); }