public void AssignCustomer_Throws_WhenCustomerAlreadyAssigned() { // Arrange var sut = new Salesperson("Alice Abraham", Group.A, Group.B); var customer1 = new Customer("Bob Roberts", false); sut.AssignCustomer(customer1); var customer2 = new Customer("Carol Christmas", false); // Act Action action = () => sut.AssignCustomer(customer2); // Assert action.Should().Throw <InvalidOperationException>(); }
public void AssignCustomer_Succeeds_AfterCustomerUnassigned() { // Arrange var sut = new Salesperson("Alice Abraham", Group.A, Group.B); var customer1 = new Customer("Bob Roberts", false); sut.AssignCustomer(customer1); sut.UnassignCustomer(); var customer2 = new Customer("Carol Christmas", false); // Act sut.AssignCustomer(customer2); // Assert sut.Assignment.Should().NotBeNull(); sut.Assignment?.Customer.Should().Be(customer2); }
public void AssignCustomer_Succeeds_WhenCustomerNotAlreadyAssigned() { // Arrange var sut = new Salesperson("Alice Abraham", Group.A, Group.B); var customer = new Customer("Bob Roberts", false); // Act sut.AssignCustomer(customer); // Assert sut.Assignment.Should().NotBeNull(); sut.Assignment?.Customer.Should().Be(customer); }