예제 #1
0
        public void SetFactionRelationshipDeltaShouldWorkMutualUnmutual()
        {
            Faction faction  = new Faction(_factionContainer, "testIdName", "Test Faction");
            Faction faction2 = new Faction(_factionContainer, "testIdName2", "Test Faction2");

            faction.SetMutualRelationship(faction2, 5);
            faction.ChangeMutualRelationship(faction2, 20);

            Assert.AreEqual(25, faction.GetRelationship(faction2));
            Assert.AreEqual(25, faction2.GetRelationship(faction));

            faction.ChangeMutualRelationship(faction2, -30);

            Assert.AreEqual(-5, faction.GetRelationship(faction2));
            Assert.AreEqual(-5, faction2.GetRelationship(faction));

            faction.ChangeRelationship(faction2, 10);


            Assert.AreEqual(5, faction.GetRelationship(faction2));
            Assert.AreEqual(-5, faction2.GetRelationship(faction));
        }