Exemplo n.º 1
0
        public void CheckCreatingClient()
        {
            // Arrange
            Client client = ClientObjectMother.CreateClient();

            deliveryFactoryMock.Setup(factory =>
                                      factory.CreateClient(client.name, client.surname, client.phone_number, client.email, client.address))
            .Returns(client);

            // Act
            Client returnedClient = deliveryService.CreateNewClient(client.name, client.surname, client.phone_number, client.email, client.address);

            // Assert
            clientRepositoryMock.Verify(r => r.InsertClient(client), Times.Once());
            Assert.AreSame(client, returnedClient);
        }