mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-23 20:36:33 +01:00
CP-6083: Updated test. Prevent potential NullReferenceException.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
parent
8ae4eaa060
commit
89fa1950a4
@ -83,7 +83,7 @@ namespace XenAdminTests.UnitTests.UnitTestHelper.MockObjectBuilders
|
||||
ObjectManager.MockProxyFor(id).Setup(
|
||||
p =>
|
||||
p.async_vgpu_create(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), "0",
|
||||
It.IsAny<object>())).Returns(new Response<string>("ok"));
|
||||
It.IsAny<object>(), It.IsAny<string>())).Returns(new Response<string>("ok"));
|
||||
return new GpuAssignAction(vm.Object, group.Object, null);
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ namespace XenAdminTests.XenModelTests.ActionTests
|
||||
protected override bool VerifyResult(GpuAssignAction action)
|
||||
{
|
||||
ObjectManager.MockProxyFor(id).Verify(p => p.async_vgpu_create(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), "0",
|
||||
It.IsAny<object>()), Times.Once());
|
||||
It.IsAny<object>(), It.IsAny<string>()), Times.Once());
|
||||
ObjectManager.MockProxyFor(id).Verify(p => p.async_vgpu_destroy(It.IsAny<string>(), It.IsAny<string>()), Times.Never());
|
||||
return true;
|
||||
}
|
||||
|
@ -69,7 +69,8 @@ namespace XenAdmin.Actions
|
||||
if (Helpers.FeatureForbidden(vm, Host.RestrictVgpu))
|
||||
VGPU.async_create(Session, vm.opaque_ref, gpu_group.opaque_ref, device, other_config);
|
||||
else
|
||||
VGPU.async_create(Session, vm.opaque_ref, gpu_group.opaque_ref, device, other_config, vgpuType.opaque_ref);
|
||||
VGPU.async_create(Session, vm.opaque_ref, gpu_group.opaque_ref, device,
|
||||
other_config, vgpuType == null ? null : vgpuType.opaque_ref);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user