Ejemplo n.º 1
0
        public void ClothesTypeMain_Equal_Category()
        {
            var first  = ClothesTypeData.ClothesTypeMainDomains.First();
            var second = new ClothesTypeMainDomain(first, CategoryData.CategoryClothesTypeDomains.First());

            Assert.True(first.Equals(second));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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());
        }