public async Task WhenLoadAsyncCompletes_ThenPropertiesArePopulated( [WindowsInstance] ResourceTask <InstanceLocator> testInstance, [Credential(Role = PredefinedRole.ComputeViewer)] ResourceTask <ICredential> credential) { var locator = await testInstance; var gceAdapter = new ComputeEngineAdapter(await credential); var model = await InstanceDetailsModel.LoadAsync( await testInstance, gceAdapter, new InventoryService(gceAdapter), CancellationToken.None); Assert.AreEqual(locator.Name, model.InstanceName); Assert.IsNull(model.Hostname); Assert.AreEqual("RUNNING", model.Status); Assert.IsNotNull(model.InternalIp); Assert.IsNotNull(model.ExternalIp); Assert.IsNotNull(model.Licenses); Assert.AreEqual(model.IsOsInventoryInformationPopulated ? FeatureFlag.Enabled : FeatureFlag.Disabled, model.OsInventory); Assert.AreEqual(FeatureFlag.Disabled, model.Diagnostics); Assert.AreEqual(FeatureFlag.Enabled, model.GuestAttributes); Assert.IsNull(model.InternalDnsMode); Assert.IsFalse(model.IsSoleTenant); }
public async Task WhenLoadAsyncCompletes_ThenPropertiesArePopulated( [WindowsInstance] InstanceRequest testInstance, [Credential(Role = PredefinedRole.ComputeViewer)] CredentialRequest credential) { await testInstance.AwaitReady(); var model = await InstanceDetailsModel.LoadAsync( await testInstance.GetInstanceAsync(), new ComputeEngineAdapter(await credential.GetCredentialAsync()), CancellationToken.None); Assert.AreEqual(testInstance.Locator.Name, model.InstanceName); Assert.IsNull(model.Hostname); Assert.AreEqual("RUNNING", model.Status); Assert.IsNotNull(model.InternalIp); Assert.IsNotNull(model.ExternalIp); Assert.IsNotNull(model.Licenses); Assert.IsFalse(model.IsSoleTenant); }