public void UsersServiceMethodUpdateShouldUpdateAUser()
        {
            // Arrange
            var unitOfWorkMock = new Mock<IUnitOfWork>();
            var repository = new UsersMemoryRepository();
            var service = new UsersService(unitOfWorkMock.Object, repository);
            var result = service.Get(UsersMemoryRepository.IdentityProvider, UsersMemoryRepository.User1RowKey);

            // Act
            result.Email = "*****@*****.**";
            service.Update(result);
            var updatedResult = service.Get(UsersMemoryRepository.IdentityProvider, UsersMemoryRepository.User1RowKey);

            // Assert
            Assert.IsTrue(updatedResult.Email == "*****@*****.**");
        }
        public void UsersServiceMethodGetShouldReturnNullForANonExistingUser()
        {
            // Arrange
            var unitOfWorkMock = new Mock<IUnitOfWork>();
            var repository = new UsersMemoryRepository();
            var service = new UsersService(unitOfWorkMock.Object, repository);

            // Act
            var result = service.Get(UsersMemoryRepository.IdentityProvider, UsersMemoryRepository.User4RowKey);

            // Assert
            Assert.IsNull(result);
        }
        public void UsersServiceMethodDeleteShouldDeleteAUser()
        {
            // Arrange
            var unitOfWorkMock = new Mock<IUnitOfWork>();
            var repository = new UsersMemoryRepository();
            var service = new UsersService(unitOfWorkMock.Object, repository);
            var result = service.Get(UsersMemoryRepository.IdentityProvider, UsersMemoryRepository.User1RowKey);

            // Act
            service.Delete(result);
            result = service.Get(UsersMemoryRepository.IdentityProvider, UsersMemoryRepository.User1RowKey);

            // Assert
            Assert.IsNull(result);
        }
        public void UsersServiceMethodGetShouldReturnAnExistingUser()
        {
            // Arrange
            var unitOfWorkMock = new Mock<IUnitOfWork>();
            var repository = new UsersMemoryRepository();
            var service = new UsersService(unitOfWorkMock.Object, repository);

            // Act
            var result = service.Get(UsersMemoryRepository.IdentityProvider, UsersMemoryRepository.User1RowKey);

            // Assert
            Assert.IsInstanceOfType(result, typeof(User));
            Assert.IsNotNull(result);
        }
        public void UsersServiceMethodCreateShouldCreateAUser()
        {
            // Arrange
            var user = new User { PartitionKey = UsersMemoryRepository.IdentityProvider, RowKey = UsersMemoryRepository.User4RowKey };
            var unitOfWorkMock = new Mock<IUnitOfWork>();
            var repository = new UsersMemoryRepository();
            var service = new UsersService(unitOfWorkMock.Object, repository);

            // Act
            service.Create(user);
            var result = service.Get(UsersMemoryRepository.IdentityProvider, UsersMemoryRepository.User4RowKey);

            // Assert
            Assert.IsInstanceOfType(result, typeof(User));
            Assert.IsNotNull(result);
        }