public void Apply_NotACharacter_Test() { var entity = Mock.Of <IEntity>(); var prone = new Prone(); prone.Apply(entity); Assert.IsTrue(true); // If we made it here without exception then the test passed }
public void Remove_NoConditions_Test() { var character = CreateMockCharacter(); var prone = new Prone(); prone.Apply(character); prone.Remove(character); Assert.AreEqual(0, character.Conditions.Count); }
public void Apply_Character_WithExistingProneCondition_Test() { var character = CreateMockCharacter(); character.Conditions.Add(new Prone()); var prone = new Prone(); prone.Apply(character); }
public void Apply_Character_NoConditions_Test() { var character = CreateMockCharacter(); var prone = new Prone(); prone.Apply(character); Assert.AreEqual(EntityIds.PRONE_CONDITION_ID, character.Conditions[0].Id); Assert.IsTrue(character.Conditions.Any(c => c.Id == EntityIds.PRONE_CONDITION_ID)); Assert.IsTrue(character.Conditions.Any(c => c.Id == EntityIds.FLAT_FOOTED_CONDITION_ID)); }
public void Apply_Character_FlatFootedToAllExists_Test() { var character = CreateMockCharacter(); var flatFooted = new FlatFooted(FlatFooted.AllCharacters); var prone = new Prone(); prone.Apply(character); var savedFlatFooted = (FlatFooted)character.Conditions.FirstOrDefault(c => c.Id == EntityIds.FLAT_FOOTED_CONDITION_ID); Assert.AreSame(flatFooted, savedFlatFooted); }
public void Remove_WithExistingFlatFootedToOne_Test() { var character = CreateMockCharacter(); var flatFooted = new FlatFooted(1); flatFooted.Apply(character); var prone = new Prone(); prone.Apply(character); prone.Remove(character); Assert.AreEqual(0, character.Conditions.Count); }
public void Apply_Character_FlatFootedToOneExists_Test() { var character = CreateMockCharacter(); var flatFooted = new FlatFooted(1); var prone = new Prone(); prone.Apply(character); var savedFlatFooted = (FlatFooted)character.Conditions.FirstOrDefault(c => c.Id == EntityIds.FLAT_FOOTED_CONDITION_ID); Assert.IsTrue(savedFlatFooted.FlatFootedFrom.Contains(FlatFooted.AllCharacters)); Assert.IsFalse(savedFlatFooted.FlatFootedFrom.Contains(1)); }
public void Remove_WithExistingFlatFootedToAll_Test() { var character = CreateMockCharacter(); var flatFooted = new FlatFooted(FlatFooted.AllCharacters); flatFooted.Apply(character); var prone = new Prone(); prone.Apply(character); prone.Remove(character); Assert.AreEqual(1, character.Conditions.Count); Assert.AreSame(flatFooted, character.Conditions[0]); }