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

            // Assert
            actual.Should().BeEmpty();
        }
Пример #2
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 Get_ItemModels_ConnectionNull_ExceptionThrown(FileSystemItemDataProvider sut, ItemIdEntity[] itemIdEntity, Guid[] ids)
        {
            // Act
            var exception = await Assert.ThrowsAsync(typeof(ArgumentNullException), async() => await sut.GetItemModels(null, itemIdEntity));

            // Assert
            exception.Message.Should().Be("connection should not be null.\r\nParameter name: connection");
        }