public void AssignCustomer_DoesNotSaveSalesRoster_WhenSalespersonNotAssigned()
        {
            // Arrange
            var salespeople = Enumerable.Empty <Salesperson>();
            var salesRoster = new SalesRoster(salespeople);
            var repo        = new FakeSalesRosterRepository(salesRoster);
            var sut         = new CustomerAssignmentService(repo, Policy.NoOp());
            var customer    = new Customer("Bob", true);

            // Act
            var assignedSalesperson = sut.AssignCustomer(customer);

            // Assert
            repo.SavedSalesRosters.Count().Should().Be(0);
        }
        public void AssignCustomer_ReturnsNull_WhenNoSalespersonAvailable()
        {
            // Arrange
            var salespeople = Enumerable.Empty <Salesperson>();
            var salesRoster = new SalesRoster(salespeople);
            var repo        = new FakeSalesRosterRepository(salesRoster);
            var sut         = new CustomerAssignmentService(repo, Policy.NoOp());
            var customer    = new Customer("Bob", true);

            // Act
            var assignedSalesperson = sut.AssignCustomer(customer);

            // Assert
            assignedSalesperson.Should().BeNull();
        }
        public void AssignCustomer_SavesSalesRoster_WhenSalespersonAssigned()
        {
            // Arrange
            var salesPerson = new Salesperson("Alice", Group.A);
            var salespeople = new List <Salesperson> {
                salesPerson
            };
            var salesRoster = new SalesRoster(salespeople);
            var repo        = new FakeSalesRosterRepository(salesRoster);
            var sut         = new CustomerAssignmentService(repo, Policy.NoOp());
            var customer    = new Customer("Bob", true);

            // Act
            var assignedSalesperson = sut.AssignCustomer(customer);

            // Assert
            repo.SavedSalesRosters.Count().Should().Be(1);
        }