public void GetHashCode_WhenCalled_ReturnsHashCodeBasedOnYearAndMonth()
        {
            short         year  = (short)_random.Next(Sut.MinYear, Sut.MaxYear);
            short         month = (short)_random.Next(Sut.MinMonth, Sut.MaxMonth);
            IInfo <IInfo> sut   = CreateSut(year, month);

            int result = sut.GetHashCode();

            Assert.That(result, Is.EqualTo(string.GetHashCode($"{year}-{month}")));
        }
Exemple #2
0
        public virtual void ReplaceInstance(Instance newInstance)
        {
            //Debug.Log($"ReplaceInstance\n{instance.id.Prop}:{instance.Info.Name} <{instance.GetType()}>\n{newInstance.id.Prop}:{newInstance.Info.Name} <{newInstance.GetType()}>\n{Info.Name} <{Info.Prefab.GetType()}>");
            instance = newInstance;

            if (newInstance.id.Type != instance.id.Type)
            {
                DebugUtils.Warning("Mismatching instances type ('" + newInstance.id.Type + "' -> '" + newInstance.id.Type + "').");
            }

            if (newInstance.Info.Prefab != Info.Prefab)
            {
                DebugUtils.Warning($"Mismatching instances info:\n{Info.Prefab.name} <{Info.GetHashCode()}>\n{newInstance.Info.Prefab.name} <{newInstance.Info.GetHashCode()}>\n");
            }
        }