public void Product_Existent() { RepositoryMock.Setup(x => x.Add(product)); RepositoryMock.Setup(x => x.GetByProductTitle(It.IsAny <string>())).Returns(product); serviceProduct.Add(product); var list = serviceProduct.GetErrors(); Assert.AreEqual(1, list.Count); }