public void Save_File_NullColumnUnit_DataTest()
        {
            IFileRepository repository = new FileRepository(testDBContext);

            var file = repository.GetItem(1, 1);
            file.FileColumns = new List<FileColumn>();
            var newFilecolumn1 = new FileColumn()
            {
                FileColumnTypeId = 1,
                FileColumnUnitId = null,
                EntityName = "entityName",
                EntityDescription = "entityDesc",
                Description = "Description"
            };

            var newFilecolumn2 = new FileColumn()
            {
                FileColumnTypeId = 1,
                FileColumnUnitId = 1,
                EntityName = "entityName1",
                EntityDescription = "entityDesc1",
                Description = "Description1"
            };

            var newFilecolumn3 = new FileColumn()
            {
                FileColumnTypeId = 1,
                FileColumnUnitId = 1,
                EntityName = "entityName2",
                EntityDescription = "entityDesc2",
                Description = "Description2"
            };

            file.FileColumns.Add(newFilecolumn1);
            file.FileColumns.Add(newFilecolumn2);
            file.FileColumns.Add(newFilecolumn3);

            testDBContext.Commit();

            var fileColumns = GetFileColumns(file.FileId);

            Assert.AreEqual(3, fileColumns.Count);
            Assert.AreEqual(newFilecolumn1.EntityName, fileColumns[0].EntityName);
            Assert.AreEqual(newFilecolumn1.EntityDescription, fileColumns[0].EntityDescription);
            Assert.AreEqual(newFilecolumn1.Description, fileColumns[0].Description);
            Assert.AreEqual(newFilecolumn1.FileColumnUnitId, fileColumns[0].FileColumnUnitId);
            Assert.AreEqual(newFilecolumn1.FileColumnTypeId, fileColumns[0].FileColumnTypeId);

            Assert.AreEqual(newFilecolumn2.EntityName, fileColumns[1].EntityName);
            Assert.AreEqual(newFilecolumn2.EntityDescription, fileColumns[1].EntityDescription);
            Assert.AreEqual(newFilecolumn2.Description, fileColumns[1].Description);
            Assert.AreEqual(newFilecolumn2.FileColumnUnitId, fileColumns[1].FileColumnUnitId);
            Assert.AreEqual(newFilecolumn2.FileColumnTypeId, fileColumns[1].FileColumnTypeId);

            Assert.AreEqual(newFilecolumn3.EntityName, fileColumns[2].EntityName);
            Assert.AreEqual(newFilecolumn3.EntityDescription, fileColumns[2].EntityDescription);
            Assert.AreEqual(newFilecolumn3.Description, fileColumns[2].Description);
            Assert.AreEqual(newFilecolumn3.FileColumnUnitId, fileColumns[2].FileColumnUnitId);
            Assert.AreEqual(newFilecolumn3.FileColumnTypeId, fileColumns[2].FileColumnTypeId);

            var columnTypeList = GetFileColumnTypes();
            //only one column type should be there, one more dummy row was added

            Assert.AreEqual(1, columnTypeList.Count());
            var columnsUnitsList = GetFileColumnUnits();

            Assert.AreEqual(1, columnsUnitsList.Count());
            testDBContext.Commit();
        }
        public void Save_File_Data()
        {
            IFileRepository repository = new FileRepository(testDBContext);

            var file = repository.GetItem(1, 1);
            file.FileColumns = new List<FileColumn>();
            var newFilecolumn = new FileColumn()
            {
                FileColumnTypeId = 1,
                FileColumnUnitId = 1,
                EntityName = "entityName",
                EntityDescription = "entityDesc",
                Description = "Description"
            };
            file.FileColumns.Add(newFilecolumn);
            testDBContext.Commit();

            var fileColumns = GetFileColumns(file.FileId);

            Assert.AreEqual(1, fileColumns.Count);
            Assert.AreEqual(newFilecolumn.EntityName, fileColumns[0].EntityName);
            Assert.AreEqual(newFilecolumn.EntityDescription, fileColumns[0].EntityDescription);
            Assert.AreEqual(newFilecolumn.Description, fileColumns[0].Description);
            Assert.AreEqual(newFilecolumn.FileColumnUnitId, fileColumns[0].FileColumnUnitId);
            Assert.AreEqual(newFilecolumn.FileColumnTypeId, fileColumns[0].FileColumnTypeId);

            var columnTypeList = GetFileColumnTypes();
            //only one column type should be there, one more dummy row was added

            Assert.AreEqual(1, columnTypeList.Count());
            var columnsUnitsList = GetFileColumnUnits();

            Assert.AreEqual(1, columnsUnitsList.Count());
            testDBContext.Commit();
        }