Пример #1
0
        public void CreateCSVFilesTest()
        {
            //Arrange
            var cameraPath      = "..\\..\\..\\..\\OnlineShop.Web\\Infrastructure\\Helper\\CSVSeed\\Camera.csv";
            var hardwarePath    = "..\\..\\..\\..\\OnlineShop.Web\\Infrastructure\\Helper\\CSVSeed\\Hardware.csv";
            var screenPath      = "..\\..\\..\\..\\OnlineShop.Web\\Infrastructure\\Helper\\CSVSeed\\Screen.csv";
            var mobilePhonePath = "..\\..\\..\\..\\OnlineShop.Web\\Infrastructure\\Helper\\CSVSeed\\MobilePhone.csv";
            var multimediaPath  = "..\\..\\..\\..\\OnlineShop.Web\\Infrastructure\\Helper\\CSVSeed\\Multimedia.csv";
            var fileManager     = new FileManager("..\\..\\..\\..\\OnlineShop.Web\\Infrastructure\\Helper");
            var cSVDBContext    = new CSVDBContext(cameraPath, hardwarePath, screenPath, mobilePhonePath, multimediaPath, fileManager);

            //Act
            cSVDBContext.CreateCSVFiles();
            //Assert
            File.Exists(cameraPath).Should().BeTrue();
            File.Exists(hardwarePath).Should().BeTrue();
            File.Exists(screenPath).Should().BeTrue();
            File.Exists(mobilePhonePath).Should().BeTrue();
            File.Exists(multimediaPath).Should().BeTrue();
            //Clean Up
            cSVDBContext.CreateCSVFiles();
            File.Delete(cameraPath);
            File.Delete(hardwarePath);
            File.Delete(screenPath);
            File.Delete(mobilePhonePath);
            File.Delete(multimediaPath);
        }
Пример #2
0
        public void RetriveCamerasFromCSVTestFileDoesntExist()
        {
            //Arrange
            var cameraPath   = "..\\..\\..\\..\\OnlineShop.Web\\Infrastructure\\Helper\\CSVSeed\\Camera.csv";
            var fileManager  = new FileManager("..\\..\\..\\..\\OnlineShop.Web\\Infrastructure\\Helper");
            var cSVDBContext = new CSVDBContext(cameraPath, null, null, null, null, fileManager);
            //Act
            var list = cSVDBContext.RetriveCamerasFromCSV();

            //Assert
            list.Should().HaveCount(0);
            list.Should().BeOfType <List <CameraCSV> >();
            File.Delete(cameraPath);
        }
Пример #3
0
        public void RetriveMobilePhonesFromCSV()
        {
            //Arrange
            var mobilePhonePath = "..\\..\\..\\..\\OnlineShop.Web\\Infrastructure\\Helper\\CSVSeed\\MobilePhone.csv";
            var fileManager     = new FileManager("..\\..\\..\\..\\OnlineShop.Web\\Infrastructure\\Helper");
            var cSVDBContext    = new CSVDBContext(null, null, null, mobilePhonePath, null, fileManager);

            cSVDBContext.CreateCSVFiles();
            //Act
            var list = cSVDBContext.RetriveMobilePhonesFromCSV();

            //Assert
            list.Should().HaveCount(30);
            list.Should().BeOfType <List <MobilePhoneCSV> >();
            File.Delete(mobilePhonePath);
        }