Пример #1
0
        public void IsUserOrganiser_WithNullUser_ReturnsFalse()
        {
            // Arrange
            var ride = new RideServiceModel
            {
                Car = new CarServiceModel
                {
                    Owner = new PoolItUserServiceModel
                    {
                        UserName = "******"
                    }
                }
            };

            var ridesService = new RidesService(null, null, null, null);

            // Act
            var result = ridesService.IsUserOrganiser(ride, null);

            // Assert
            Assert.False(result);
        }
Пример #2
0
        public void IsUserOrganiser_WithUserOrganiser_ReturnsTrue()
        {
            // Arrange
            const string testUser = "******";

            var ride = new RideServiceModel
            {
                Car = new CarServiceModel
                {
                    Owner = new PoolItUserServiceModel
                    {
                        UserName = testUser
                    }
                }
            };

            var ridesService = new RidesService(null, null, null, null);

            // Act
            var result = ridesService.IsUserOrganiser(ride, testUser);

            // Assert
            Assert.True(result);
        }