public void CheckIfDoubleEdgedPipeIsDeletedCorrectly() { var position = new Coordinate(2, 3); var pipe = new DoubleEdgedPipe(EdgeType.DOWN, EdgeType.UP); var key = new PipePosition(position, pipe.FirstEdge, pipe.SecondEdge); doubleEdgedPipes.Add(key, mockPipe.Object); blueprintBuilderViewModel.DoubleEdgePipeDeleted(mockBlueprint.Object, position, pipe); Assert.IsFalse(doubleEdgedPipes.ContainsKey(key)); }
public void CheckIfObjectIsDeletedFromView() { var position = new Coordinate(2, 3); blocks.Add(position, mockBlock.Object); blueprintBuilderViewModel.BlockDeleted(mockBlueprint.Object, position); mockBlock.Verify(block => block.Delete(), Times.Once()); Assert.IsFalse(blocks.ContainsKey(position)); }
public void ShipComponentIsDeletedCorrectly() { var position = new Coordinate(1, 2); shipComponents.Add(position, mockBuilderObject.Object); objectTable.DeleteShipComponent(position); Assert.IsFalse(shipComponents.ContainsKey(position)); }
public void BlockIsDeletedCorrectly() { var position = new Coordinate(1, 2); blocks.Add(position, mockBuilderObject.Object); objectTable.DeleteBlock(position); Assert.IsFalse(blocks.ContainsKey(position)); }
public void CanAddWorldObjectToDictionary() { var dictionary = new WorldObjectDictionary <int, IWorldObject>(); var mockObject = new Mock <IWorldObject>(); dictionary.Add(3, mockObject.Object); Assert.AreEqual(mockObject.Object, dictionary[3]); }
public void WorldObjectDeletesWhenRemovedFromDictionary() { var dictionary = new WorldObjectDictionary <int, IWorldObject>(); var mockObject = new Mock <IWorldObject>(); dictionary.Add(3, mockObject.Object); dictionary.Remove(3); mockObject.Verify(mock => mock.Delete(), Times.Once()); }
public void CheckIfPipeIsDeletedCorrectly() { var position = new Coordinate(1, 4); var key = new PipePosition(position, EdgeType.LEFT, EdgeType.RIGHT); doubleEdgedPipes.Add(key, mockBuilderObject.Object); objectTable.DeletePipe(position, EdgeType.LEFT, EdgeType.RIGHT); Assert.IsFalse(doubleEdgedPipes.ContainsKey(key)); mockBuilderObject.Verify(mock => mock.Delete(), Times.Once()); }
public void CheckIfShipComponentIsDeletedCorrectly() { var position = new Coordinate(1, 3); shipComponents.Add(position, mockShipComponent.Object); blueprintBuilderViewModel.ShipComponentDeleted(mockBlueprint.Object, position); mockShipComponent.Verify(component => component.Delete(), Times.Once()); Assert.IsFalse(shipComponents.ContainsKey(position)); }
public void SetPipe(Coordinate position, EdgeType firstEdge, EdgeType secondEdge, IWorldObject pipeObject) { doubleEdgedPipes.Add(new PipePosition(position, firstEdge, secondEdge), pipeObject); }
public void SetShipComponent(Coordinate position, IActivateableWorldObject shipComponent) { shipComponents.Add(position, shipComponent); }
public void SetBlock(Coordinate position, IActivateableWorldObject block) { blocks.Add(position, block); }