public void ClothesTypeMain_Equal_Category() { var first = ClothesTypeData.ClothesTypeMainDomains.First(); var second = new ClothesTypeMainDomain(first, CategoryData.CategoryClothesTypeDomains.First()); Assert.True(first.Equals(second)); }
public void ClothesType_Equal_ClothesType() { var first = ClothesTypeData.ClothesTypeMainDomains.First(); var second = new ClothesTypeMainDomain(first.Name, first.SizeTypeDefault, first.Category); Assert.True(first.Equals(second)); }
public void ValidateModel_NameError() { var clothesType = ClothesTypeData.ClothesTypeMainDomains.First(); var clothesTypeEmptyName = new ClothesTypeMainDomain(String.Empty, SizeType.American, clothesType.Category); var result = ValidateModel(clothesTypeEmptyName); Assert.True(result.HasErrors); Assert.True(result.Errors.First().ErrorResultType == ErrorResultType.ValueNotValid); }
public async Task ValidateIncludes_CategoryNotFound() { var category = new CategoryDomain("NotFound"); var clothesType = ClothesTypeData.ClothesTypeMainDomains.First(); var clothesTypeNotFound = new ClothesTypeMainDomain(clothesType, category); var result = await ValidateIncludes(clothesTypeNotFound); Assert.True(result.HasErrors); Assert.True(result.Errors.First().ErrorResultType == ErrorResultType.ValueNotFound); }
public void ClothesTypeMain_Equal_Ok() { const string name = "Свитер"; const SizeType sizeTypeDefault = SizeType.American; var categoryDomain = new CategoryDomain("Верхушка"); var clothesTypeMainDomain = new ClothesTypeMainDomain(name, sizeTypeDefault, categoryDomain); int clothesTypeHash = HashCode.Combine(name, categoryDomain.GetHashCode()); Assert.Equal(clothesTypeHash, clothesTypeMainDomain.GetHashCode()); }