public void WhenGetCalledMultipleTimes_ThenSameInstanceIsReturned() { var config = CreateConfig(); HealthVaultConnectionFactoryInternal healthVaultConnectionFactoryInternal = new HealthVaultConnectionFactoryInternal(); IHealthVaultSodaConnection connection = healthVaultConnectionFactoryInternal.GetOrCreateSodaConnection(config); IHealthVaultSodaConnection connection2 = healthVaultConnectionFactoryInternal.GetOrCreateSodaConnection(config); Assert.AreEqual(connection, connection2); }
public void WhenCalledWithDifferentMasterAppId_ThenInvalidOperationExceptionThrown() { var config1 = CreateConfig(); var config2 = new HealthVaultConfiguration { MasterApplicationId = new Guid("e2bab95d-cbb4-497e-ac2a-122d53a04b7a") }; HealthVaultConnectionFactoryInternal healthVaultConnectionFactoryInternal = new HealthVaultConnectionFactoryInternal(); IHealthVaultSodaConnection connection = healthVaultConnectionFactoryInternal.GetOrCreateSodaConnection(config1); healthVaultConnectionFactoryInternal.GetOrCreateSodaConnection(config2); }
public void WhenCalledWithoutMasterAppId_ThenInvalidOperationExceptionThrown() { HealthVaultConnectionFactoryInternal healthVaultConnectionFactoryInternal = new HealthVaultConnectionFactoryInternal(); healthVaultConnectionFactoryInternal.GetOrCreateSodaConnection(new HealthVaultConfiguration()); }