public void TestEqual() { WallBeam wallBeam = new WallBeam(POINT); WallBeam anotherWallBeam = new WallBeam(POINT); Assert.AreEqual(wallBeam, anotherWallBeam); }
public PriceAndCost GetPriceAndCostWallBeam() { WallBeam wallBeam = wallBeamHandler.GetFirst(); PriceAndCost priceAndCost = _context.PricesAndCosts .Where(p => p.PriceAndCostId == 2) .FirstOrDefault(); return(priceAndCost); }
public void AddWallBeam(Grid grid, WallBeam wallBeam) { var co = (from c in _context.Grids where c.GridId == grid.GridId select c).FirstOrDefault(); co.WallBeams.Add(wallBeam); _context.SaveChanges(); }
public void TestGetWallBeam() { Point point = new Point(0, 1); WallBeam wallBeam = new WallBeam(point); grid.WallBeams.Add(wallBeam); WallBeam expectedResult = grid.GetWallBeam(point); Assert.AreEqual(wallBeam, expectedResult); }
public void TestValidWallBeamFalse() { Point point = new Point(0, 1); WallBeam wallBeam = new WallBeam(point); grid.WallBeams.Add(wallBeam); WallBeam anotherWallBeam = new WallBeam(point); bool expectedResult = false; bool result = grid.FreePosition(point); Assert.AreEqual(result, expectedResult); }
public void Remove(Grid grid, WallBeam wallBeam) { WallBeam wallBeamToDelete = null; wallBeamToDelete = _context.WallBeams .Where(w => (w.Grid.GridId == grid.GridId && w.WallBeamId == wallBeam.WallBeamId)) .FirstOrDefault(); _context.WallBeams.Remove(wallBeamToDelete); _context.SaveChanges(); }
public bool Exist(Grid grid, Point ubicationPoint) { WallBeam wallBeamToFind = null; wallBeamToFind = _context.WallBeams .Where(w => (w.Grid.GridId == grid.GridId && w.UbicationPoint.X == ubicationPoint.X) && w.UbicationPoint.Y == ubicationPoint.Y) .FirstOrDefault(); return(!(wallBeamToFind == null)); }
public void TestRemoveWallBeam() { Point point = new Point(0, 1); WallBeam wallBeam = new WallBeam(point); Point anotherPoint = new Point(0, 5); WallBeam anotherWallBeam = new WallBeam(anotherPoint); grid.WallBeams.Add(anotherWallBeam); grid.WallBeams.Add(wallBeam); grid.WallBeams.Remove(wallBeam); bool resultExpected = true; bool result = grid.WallBeams.Count.Equals(1); Assert.AreEqual(resultExpected, result); }
public void Add(Grid grid, WallBeam wallBeam, PriceAndCost priceAndCost) { try { PriceAndCost priceCost = _context.PricesAndCosts .Where(w => w.PriceAndCostId == priceAndCost.PriceAndCostId) .FirstOrDefault(); wallBeam.PriceAndCost = priceCost; _context.Grids.Attach(grid); wallBeam.Grid = grid; _context.WallBeams.Add(wallBeam); _context.SaveChanges(); } catch (Exception e) { } }
public void TestCreateWallBeam() { WallBeam wallBeam = new WallBeam(POINT); Assert.IsNotNull(wallBeam); }