public void CreateFeedbackAndRating_AnyCallId_AnyCustomerId_AnySpecialistId_False()
        {
            // Setup dependence
            var settingMock = new Mock<ISettings>();
            var componentMock = new Mock<IComponents>();
            var uowMock = new Mock<IUnitOfWork>();
            var repositoryMock = new Mock<IRepository>();
            var serviceLocatorMock = new Mock<IServiceLocator>();

            serviceLocatorMock.Setup(r => r.GetInstance<IRepository>())
                .Returns(repositoryMock.Object);
            ServiceLocator.SetLocatorProvider(()=> serviceLocatorMock.Object);

            // Arrange data
            Guid id = Guid.NewGuid();
            string feedBack = "feedback";
            int? start = 4;
            bool expectedResult = false;

            // Act
            CallService callService = new CallService(uowMock.Object, repositoryMock.Object, settingMock.Object, componentMock.Object);
            bool currentResult = callService.CreateFeedbackAndRating(id, id, id, feedBack, start);

            // Assert
            Assert.AreEqual(expectedResult, currentResult);
        }
        public void CreateFeedbackAndRating_AnyCallId_AnyCustomerId_AnySpecialistId_True()
        {
            // Setup dependence
            var settingMock = new Mock<ISettings>();
            var componentMock = new Mock<IComponents>();
            var repositoryMock = new Mock<IRepository>();
            var serviceLocatorMock = new Mock<IServiceLocator>();
            var uowMock = new Mock<IUnitOfWork>();

            serviceLocatorMock.Setup(r => r.GetInstance<IRepository>())
                .Returns(repositoryMock.Object);
            serviceLocatorMock.Setup(r => r.GetInstance<IUnitOfWork>())
                .Returns(uowMock.Object);
            ServiceLocator.SetLocatorProvider(() => serviceLocatorMock.Object);

            // Arrange data
            Guid id = Guid.NewGuid();
            bool expectedResult = true;

            string feedBack = "feedback";
            int? start = 4;
            Call call = new Call
            {
                Id = id
            };
            repositoryMock.Setup(r => r.FindById<Call>(id)).Returns(call);
            repositoryMock.Setup(r => r.CreateUnitOfWork()).Returns(uowMock.Object);

            // Act
            CallService callService = new CallService(uowMock.Object, repositoryMock.Object, settingMock.Object, componentMock.Object);
            bool currentResult = callService.CreateFeedbackAndRating(id, id, id, feedBack, start);

            // Assert
            repositoryMock.Verify(r => r.FindById<Call>(id));
            repositoryMock.Verify(r => r.Update<Call>(It.Is<Call>(c=>c.Rating == start
                && c.Feedback.Equals(feedBack))));
            uowMock.Verify(u=>u.Save());
            Assert.AreEqual(expectedResult, currentResult);
        }