示例#1
0
        public void TestMealTypeHasSameHashCodeAsMealTypeWithEqualName()
        {
            string name = ExistingMealTypesService.ExistingMealTypes[0];

            MealType mealType = MealType.ValueOf(name);

            MealType equalMealType = MealType.ValueOf(name);

            int mealTypeHashCode = mealType.GetHashCode();

            int equalMealTypeHashCode = equalMealType.GetHashCode();

            Assert.Equal(mealTypeHashCode, equalMealTypeHashCode);
        }
示例#2
0
        public void TestMealTypeHasDifferentHashCodeAsMealTypeWithEqualName()
        {
            string name = ExistingMealTypesService.ExistingMealTypes[0];

            MealType mealType = MealType.ValueOf(name);

            MealType differentMealType = MealType.ValueOf(ExistingMealTypesService.ExistingMealTypes[1]);

            int mealTypeHashCode = mealType.GetHashCode();

            int differentMealTypeHashCode = differentMealType.GetHashCode();

            Assert.NotEqual(mealTypeHashCode, differentMealTypeHashCode);
        }