public void AddManufacturer() { // Arrange var stubManufacturers = new InMemoryDbSet<Manufacturer>(); var manufacturer = new Manufacturer() { Name = "Dummy" }; stubEntities.Manufacturers = stubManufacturers; // Act var sut = new EquipmentRepository(stubEntities, stubLogger); sut.AddManufacturer(manufacturer); // Assert Assert.AreEqual(1, stubManufacturers.Count(), "Manufacturers count incorrect"); }
public void AddManufacturer() { // Arrange int expected = _context.Manufacturers.Count() + 1; var manufacturer = new Manufacturer() { Name = "Dummy" }; var sut = new EquipmentRepository(_context, _stubLogger); // Act sut.AddManufacturer(manufacturer); _context.Save(); int actual = _context.Manufacturers.Count(); // Assert Assert.AreEqual(expected, actual, "Manufacturers count incorrect"); }
public Manufacturer AddManufacturer(Manufacturer manufacturer) { return Add(_context.Manufacturers, manufacturer, m => String.Compare(m.Name, manufacturer.Name, true) == 0); }