public void AddBoard() { // Arrange var stubBoards = new InMemoryDbSet<Board>(); var board = new Board() { Model = new BoardModel { Name = "Dummy" }, Volume = 1 }; stubEntities.Boards = stubBoards; // Act var sut = new EquipmentRepository(stubEntities, stubLogger); sut.AddBoard(board); // Assert Assert.AreEqual(1, stubBoards.Count(), "Boards count incorrect"); }
public void AddBoard() { // Arrange int expected = _context.Boards.Count() + 1; var board = new Board() { Model = new BoardModel() { Manufacturer = _context.Manufacturers.Single(m => m.Name == "JP"), Name = "Dummy" }, Volume = 74 }; var sut = new EquipmentRepository(_context, _stubLogger); // Act sut.AddBoard(board); _context.Save(); // Assert Assert.AreEqual(expected, _context.Boards.Count(), "Boards count incorrect"); }
public Board AddBoard(Board board) { return Add(_context.Boards, board, b => String.Compare(b.Model.Name, board.Model.Name, true) == 0 && b.Volume == board.Volume); }