public async void GetSkinnyItems_IdItemEntityEmpty_ReturnsEmpty(FileSystemItemDataProvider sut, IFileSystemConnection connection)
        {
            // Act
            var actual = await sut.GetSkinnyItems(connection, new List <ItemIdEntity>());

            // Assert
            actual.Should().BeEmpty();
        }
        public async void GetSkinnyItems_ConnectionNull_ExceptionThrown(FileSystemItemDataProvider sut, ItemIdEntity[] itemIdEntity)
        {
            // Act
            var exception = await Assert.ThrowsAsync(typeof(ArgumentNullException), async() => await sut.GetSkinnyItems(null, itemIdEntity));

            // Assert
            exception.Message.Should().Be("connection should not be null.\r\nParameter name: connection");
        }
Exemple #3
0
        public async void GetSkinnyItems_SkinnyModelsReturned(
            FileSystemItemDataProvider sut,
            FileSystemConnection connection,
            List <ItemIdEntity> itemIdEntities)
        {
            //Act
            var items = await sut.GetSkinnyItems(connection, itemIdEntities);

            var skinnyItemModels = items as SkinnyItemModel[] ?? items.ToArray();

            //Assert
            Assert.Equal(2, skinnyItemModels.Count());
            Assert.Equal(Guid.Parse("133b85182d0348038ed03d7693df50db"), skinnyItemModels.FirstOrDefault().ModelId);
            Assert.Equal(Guid.Parse("8a7a7adc9d604e389dd9d719f1316c25"), skinnyItemModels[1].ModelId);
        }
Exemple #4
0
        public async void GetItemModels_ItemModelsReturned(
            FileSystemItemDataProvider sut,
            FileSystemConnection connection,
            List <ItemIdEntity> itemIdEntities)
        {
            //Act
            var items = await sut.GetItemModels(connection, itemIdEntities);

            var resultList = items as Tuple <SkinnyItemModel, ItemModel>[] ?? items.ToArray();

            //Assert
            Assert.Equal(2, resultList.Count());
            Assert.Equal(Guid.Parse("133b85182d0348038ed03d7693df50db"), resultList.FirstOrDefault().Item2.ModelId);
            Assert.Equal(Guid.Parse("8a7a7adc9d604e389dd9d719f1316c25"), resultList[1].Item2.ModelId);
            Assert.Equal(Guid.Parse("133b85182d0348038ed03d7693df50db"), resultList.FirstOrDefault().Item1.ModelId);
            Assert.Equal(Guid.Parse("8a7a7adc9d604e389dd9d719f1316c25"), resultList[1].Item1.ModelId);
        }
 public async void GetSkinnyItems_IdItemEntityNull_ExceptionThrown(FileSystemItemDataProvider sut, IFileSystemConnection connection)
 {
     // Act
     var exception = await Assert.ThrowsAsync(typeof(ArgumentNullException), async() => await sut.GetSkinnyItems(connection, null));
 }