public void ToObject_Test_ReturnsNotNullObjectGivenValidInput()
        {
            var table = TableMaker.GenerateDataTable <MockSystemFile>(1);

            var returnedObject = table.Rows[0].ToObject <MockSystemFile>();

            Assert.IsNotNull(returnedObject);
        }
        public void ToList_Test_ReturnsNotNullListGivenValidInput()
        {
            var table = TableMaker.GenerateDataTable <MockMetadataFile>(5);

            var list = table.ToList <MockMetadataFile>();

            Assert.IsNotNull(list);
        }
Exemplo n.º 3
0
        public void ToListAsync_Test_TaskReturnsNoExceptions()
        {
            _table = TableMaker.GenerateDataTable <MockMetadataFile>(5);

            var taskResult = _table.ToListAsync <MockMetadataFile>();

            Assert.IsNull(taskResult.Exception);
        }
Exemplo n.º 4
0
        public async Task ToListAsync_Test_ReturnsNotNullListGivenValidInput()
        {
            var table = TableMaker.GenerateDataTable <MockMetadataFile>(5);

            var list = await table.ToListAsync <MockMetadataFile>();

            Assert.IsNotNull(list);
        }
Exemplo n.º 5
0
        public async Task ToListAsync_Test_ReturnsEmptyListGivenEmptyInput()
        {
            _table = TableMaker.GenerateDataTable <MockMetadataFile>(1);
            _table.Clear();

            var list = await _table.ToListAsync <MockMetadataFile>();

            Assert.AreEqual(list.Count, 0);
        }
Exemplo n.º 6
0
        public void ToList_Test_ReturnsPopulatedListGivenInputWithNoNullablePropertyTypes()
        {
            var numOfObjects = 5;
            var table        = TableMaker.GenerateDataTable <MockSystemFile>(numOfObjects);

            var list = table.Rows.ToList <MockSystemFile>();

            Assert.IsTrue(list.Count == numOfObjects);
        }
        public void ToList_Test_ReturnsListWithSameSizeAsInput()
        {
            Random random = new Random();
            var    numOfRowsToGenerate = random.Next(1, 100);
            var    table = TableMaker.GenerateDataTable <MockMetadataFile>(numOfRowsToGenerate);

            var list = table.ToList <MockMetadataFile>();

            Assert.AreEqual(list.Count, numOfRowsToGenerate);
        }
        public void ToList_Test_ReturnsEmptyListGivenEmptyInput()
        {
            var table = TableMaker.GenerateDataTable <MockMetadataFile>(1);

            table.Clear();

            var list = table.ToList <MockMetadataFile>();

            Assert.AreEqual(list.Count, 0);
        }
Exemplo n.º 9
0
        public void ToList_Test_ThrowsArgumentExceptionGivenUnparsableInput()
        {
            var table = TableMaker.GenerateDataTable <MockSystemFile>(1);

            Assert.ThrowsException <ArgumentException>(() => table.Rows.ToList <MockMetadataFile>());
        }