public void GetUserCollections_UserWithoutCollections_NoCollections(string userId)
        {
            //Arrange
            AddUser(userId);

            //Act
            ICollection <Collection> collections = null;

            InTransaction(context =>
            {
                var controller = new CollectionsController(context, GetUserProviderMock(userId), getCollectionConfigurationProviderMock());
                collections    = controller.GetUserCollections();
            });

            //Assert
            collections.Should().BeEmpty();
        }
        public void GetUserCollections_CollectionHasElements_ElementsReturned(int numberOfElements)
        {
            //Arrange
            var userId = NewGuid;

            AddUser(userId);
            AddCollection(userId, numberOfElements);

            //Act
            ICollection <Collection> collections = null;

            InTransaction(context =>
            {
                var controller = new CollectionsController(context, GetUserProviderMock(userId), getCollectionConfigurationProviderMock());
                collections    = controller.GetUserCollections();
            });

            //Assert
            collections.Single().Elements.Should().HaveCount(numberOfElements);
        }
        public void GetUserCollections_CollectionsWithoutElements_NoElementsReturned(int numberOfCollections)
        {
            //Arrange
            var userId = NewGuid;

            AddUser(userId);
            for (var i = 0; i < numberOfCollections; i++)
            {
                AddCollection(userId, 0);
            }

            //Act
            ICollection <Collection> collections = null;

            InTransaction(context =>
            {
                var controller = new CollectionsController(context, GetUserProviderMock(userId), getCollectionConfigurationProviderMock());
                collections    = controller.GetUserCollections();
            });

            //Assert
            collections.SelectMany(c => c.Elements).Should().BeEmpty();
        }
        public void GetUserCollections_UserWithXCollections_XCollectionsReturned(int numberOfCollections)
        {
            //Arrange
            var userId = NewGuid;

            AddUser(userId);
            for (var i = 0; i < numberOfCollections; i++)
            {
                AddCollection(userId, 0);
            }

            //Act
            ICollection <Collection> collections = null;

            InTransaction(context =>
            {
                var controller = new CollectionsController(context, GetUserProviderMock(userId), getCollectionConfigurationProviderMock());
                collections    = controller.GetUserCollections();
            });

            //Assert
            collections.Should().HaveCount(numberOfCollections);
        }