public async Task TestCreateModel_WithFabricCategory() { MaterialService service = this.Service; Task <Models.Category> testCategory = Task.Run(() => this.CategoryDataUtil.GetTestCategory_Fabric()); testCategory.Wait(); Models.Material testData = new Models.Material() { Category = testCategory.Result, Name = "TEST MATERIAL FABRIC", Description = "TEST MATERIAL FABRIC DESCRIPTION", Composition = string.Empty, Construction = string.Empty, Width = string.Empty, Yarn = string.Empty }; try { await service.CreateModel(testData); } catch (ServiceValidationExeption ex) { ValidationResult compositionValidation = ex.ValidationResults.FirstOrDefault(r => r.MemberNames.Contains("Composition")); Assert.NotNull(compositionValidation); ValidationResult constructionValidation = ex.ValidationResults.FirstOrDefault(r => r.MemberNames.Contains("Construction")); Assert.NotNull(constructionValidation); ValidationResult widthValidation = ex.ValidationResults.FirstOrDefault(r => r.MemberNames.Contains("Width")); Assert.NotNull(widthValidation); ValidationResult yarnValidation = ex.ValidationResults.FirstOrDefault(r => r.MemberNames.Contains("Yarn")); Assert.NotNull(yarnValidation); } }