AddCustomer requires testing because it executes business logic - it extracts the company and installs it, it checks the data, adds data to the repository and returns the result.
Your test is almost correct. I would make it a little more specific in order to test all the business logic:
[Test] [TestCase(true)] [TestCase(false)] public void AddCustomer(bool isCustomerValid) {
In the above test, all the functionality of the service method will be checked, including if the company is selected by identifier, and if the extracted one is used. In addition, it checks if the client has been added, if it is valid. The test will fail if the client is added, if it is invalid (since the Repository client was created using MockBehavior.Strict, and the configuration will not be completed).
source share