private void SetBlueprint() { toReport.InsertWall(new Point(0, 0), new Point(5, 0)); toReport.InsertWall(new Point(0, 0), new Point(0, 5)); toReport.InsertColumn(new Point(1, 1)); toReport.InsertColumn(new Point(1, 2)); Template temp = new Template("Slider", 2, 1, 1.9F, ComponentType.WINDOW); Opening window1 = new Window(new Point(0, 2), temp); Opening window2 = new Window(new Point(2, 0), temp); toReport.InsertOpening(window1); toReport.InsertOpening(window2); }
public void OpeningsPersistenceCountTest() { IRepository <Template> tempStorage = new OpeningTemplateRepository(); tempStorage.Clear(); Template gate = new Template("Gate", 2, 0, 2, ComponentType.DOOR); tempStorage.Add(gate); Opening gateOp = new Door(new Point(1, 1), gate); Opening otherGateOp = new Door(new Point(2, 2), gate); blueprint1.InsertWall(new Point(0, 2), new Point(4, 2)); blueprint1.InsertWall(new Point(0, 1), new Point(4, 1)); blueprint1.InsertOpening(gateOp); blueprint1.InsertOpening(otherGateOp); portfolio.Add(blueprint1); IBlueprint retrieved = portfolio.Get(blueprint1.GetId()); int expectedResult = 2; int actualResult = retrieved.GetWalls().Count; Assert.AreEqual(expectedResult, actualResult); }
public void InsertOpening(Opening aOpening) { CheckPermission(Permission.EDIT_BLUEPRINT); blueprint.InsertOpening(aOpening); if (!templates.Exists(aOpening.getTemplate())) { templates.Add(aOpening.getTemplate()); } repository.Modify(blueprint); HasBeenModify = true; }