public void AddSail()
        {
            // Arrange
            var stubSails = new InMemoryDbSet<Sail>();
            var sail = new Sail() { Model = new SailModel { Name = "Dummy" }, Size = 4.7 };
            stubEntities.Sails = stubSails;

            // Act
            var sut = new EquipmentRepository(stubEntities, stubLogger);
            sut.AddSail(sail);

            // Assert
            Assert.AreEqual(1, stubSails.Count(), "Sails count incorrect");
        }
        public void AddSail()
        {
            // Arrange
            int expected = _context.Sails.Count() + 1;
            var sail = new Sail() { Size = 4.7, Model = new SailModel() { Name = "Dummy", Manufacturer = _context.Manufacturers.Single(m => m.Name == "Tushingham") } };
            var sut = new EquipmentRepository(_context, _stubLogger);

            // Act
            sut.AddSail(sail);
            _context.Save();

            // Assert
            Assert.AreEqual(expected, _context.Sails.Count(), "Sails count incorrect");
        }
 public Sail AddSail(Sail sail)
 {
     return Add(_context.Sails, sail, s => String.Compare(s.Model.Name, sail.Model.Name, true) == 0 && s.Size == sail.Size);
 }