示例#1
0
        public void DeleteRefoodUserById_Success_Test()
        {
            // Arrange
            int id = 1;

            // create mock for repository
            var mock = new Mock <IRefoodUserRepository>();

            mock.Setup(s => s.DeleteRefoodUser(Moq.It.IsAny <int>())).Verifiable();

            // service
            RefoodUserService refoodUserService = new RefoodUserService();

            RefoodUserService.Repository = mock.Object;

            // Act
            refoodUserService.DeleteRefoodUser(id);

            // Assert
            Assert.IsTrue(true);
        }
示例#2
0
        public void DeleteRefoodUser_Success_Test()
        {
            // Arrange
            RefoodUserDTO dto = SampleRefoodUserDTO(1);

            dto.IsDeleted = false;

            // create mock for repository
            var mock = new Mock <IRefoodUserRepository>();

            mock.Setup(s => s.DeleteRefoodUser(Moq.It.IsAny <R_RefoodUser>())).Verifiable();

            // service
            RefoodUserService refoodUserService = new RefoodUserService();

            RefoodUserService.Repository = mock.Object;

            // Act
            refoodUserService.DeleteRefoodUser(dto);

            // Assert
            Assert.IsTrue(true);
        }