public void Vm_getOsCategory_shouldThrowWithcorrectMessage() { List <VmOsDto> osList = new List <VmOsDto>(); osList.Add(new VmOsDto() { Key = "windows1", Category = "test1", DisplayValue = "disp1" }); var ex = Assert.Throws <Exception>(() => AzureVmUtil.GetOsCategory(osList, "asdasas")); Assert.Equal("Unable to find Operating System record in list of available", ex.Message); }
public void Vm_getOsCategory_shouldReturnExpectedResult() { List <VmOsDto> osList = new List <VmOsDto>(); osList.Add(new VmOsDto() { Key = "windows1", Category = "test1", DisplayValue = "disp1" }); var result = AzureVmUtil.GetOsCategory(osList, "windows1"); var expectedResult = "test1"; Assert.Equal(expectedResult, result); }
public void Vm_getOsCategory_WithNullasOsList_shouldThrowWithcorrectMessage() { var ex = Assert.Throws <ArgumentException>(() => AzureVmUtil.GetOsCategory(null, "aaa")); Assert.Equal("List of OS is null", ex.Message); }