public void CreateOpeningFromTemplateNameTest()
        {
            OpeningFactory factory  = new OpeningFactory(templateRepository);
            Point          position = new Point(1, 1);
            Opening        expected = new Window(position, template1);
            Opening        window1  = factory.CreateFromTemplate(position, template1.Name);

            Assert.AreEqual(expected.getTemplate(), window1.getTemplate());
        }
        public EditBlueprintView(Session aSession, LoggedInView aParent, Blueprint aBlueprint)
        {
            InitializeComponent();

            CurrentSession                 = aSession;
            parent                         = aParent;
            selectedBluePrint              = aBlueprint;
            parent.ParentForm.FormClosing += new FormClosingEventHandler(CheckSignmentEventHandler);

            BlueprintPanel.Cursor = Cursors.Cross;
            IRepository <IBlueprint> bpStorage           = new BlueprintRepository();
            IRepository <Template>   templatesRepository = new OpeningTemplateRepository();

            editor = new BlueprintEditor(aSession, aBlueprint, bpStorage, templatesRepository);
            IRepository <Template> templates = new OpeningTemplateRepository();

            openingFactory = new OpeningFactory(templates);


            int gridLinesMarginToLayerInPixels    = 1;
            int drawSurfaceMarginToWindowInPixels = 10;
            int gridCellCountX         = aBlueprint.Length;
            int gridCellCountY         = aBlueprint.Width;
            int windowXBoundryInPixels = this.BlueprintPanel.Width;
            int windowYBoundryInPixels = this.BlueprintPanel.Height;

            drawer = new Drawer(gridCellCountX, gridCellCountY, 40, windowXBoundryInPixels, windowYBoundryInPixels, gridLinesMarginToLayerInPixels, drawSurfaceMarginToWindowInPixels);
            LoadGridPaintStrategies();
            setUpDrawSurface(40);

            PaintWalls();
            PaintBeams();
            PaintOpenings();
            PaintColumns();
            calulateCostsAndPrices();
            ShowOrHideSignButton();
            ShowOrHideTools();

            ICollection <Template> templatesInDB = editor.GetTemplates();

            cmbTemplates.DataSource = templatesInDB;
        }
 public void CreateOpeningFromNullTemplateNameTest()
 {
     OpeningFactory factory  = new OpeningFactory(templateRepository);
     Point          position = new Point(1, 1);
     Opening        window1  = factory.CreateFromTemplate(position, null);
 }
 public void CreateOpeningFromNoneExistentTemplateNameTest()
 {
     OpeningFactory factory  = new OpeningFactory(templateRepository);
     Point          position = new Point(1, 1);
     Opening        window1  = factory.CreateFromTemplate(position, "this template does not exist");
 }
        public void ConstructorTest()
        {
            OpeningFactory factory = new OpeningFactory(templateRepository);

            Assert.IsNotNull(factory);
        }