public static PSSecuritySecureScore ConvertToPSType(this SecureScoreItem value) { return(new PSSecuritySecureScore { Id = value.Id, Name = value.Name, Type = value.Type, DisplayName = value.DisplayName, CurrentScore = value.Current, MaxScore = value.Max, Percentage = value.Percentage, Weight = value.Weight }); }
private static void ValidateSecureScoreItem(SecureScoreItem item) { Assert.NotNull(item); Assert.NotNull(item.DisplayName); Assert.NotNull(item.Id); Assert.NotNull(item.Type); Assert.NotNull(item.Current); Assert.NotNull(item.Max); Assert.NotNull(item.Weight); Assert.NotNull(item.Percentage); Assert.True(item.Max >= 0); Assert.Equal("Microsoft.Security/secureScores", item.Type); Assert.True(item.Current >= 0.00 && item.Current <= item.Max); Assert.True(item.Weight >= 0); Assert.True(item.Percentage >= 0.00 && item.Percentage <= 1.00); }