コード例 #1
0
 public FilePatch(bool isUpdate, DirectorySetup directorySetup, SysFileInfo fileInfo, FileHash hash)
 {
     IsUpdate       = isUpdate;
     DirectorySetup = directorySetup;
     FileInfo       = fileInfo;
     Hash           = hash;
 }
コード例 #2
0
        public void GivenTheOutputFolderIsEmpty()
        {
            var           outputZone    = DirectorySetup.GetPath(ConfigurationManager.AppSettings[InputData.OutputZone]);
            DirectoryInfo directoryInfo = new DirectoryInfo(outputZone);

            directoryInfo.Empty();
        }
コード例 #3
0
 void compareEntities(DirectorySetup entityA, DirectorySetup entityB)
 {
     Assert.AreEqual(entityA.Id, entityB.Id, "faulty id");
     Assert.AreEqual(entityA.Created, entityB.Created, "faulty creation timestamp");
     Assert.AreEqual(entityA.LastChange, entityB.LastChange, "faulty last change timestamp");
     Assert.AreEqual(entityA.Path, entityB.Path, "faulty path");
     Assert.AreEqual(entityA.Name, entityB.Name, "faulty name");
     Assert.AreEqual(entityA.Description, entityB.Description, "faulty description");
 }
コード例 #4
0
 void compareEntityToDto(DirectorySetup entity, DirectorySetupDTO dto)
 {
     Assert.AreEqual((Guid)entity.Id, dto.Id, "faulty id");
     Assert.AreEqual(entity.Created, dto.Created, "faulty creation timestamp");
     Assert.AreEqual(entity.LastChange, dto.LastChange, "faulty last change timestamp");
     Assert.AreEqual(entity.Path, dto.Path, "faulty path");
     Assert.AreEqual((string)entity.Name, dto.Name, "faulty name");
     Assert.AreEqual((string)entity.Description, dto.Description, "faulty description");
 }
コード例 #5
0
        public void WhenBlackBoxProgramIsExecuted()
        {
            var dropZone   = DirectorySetup.GetPath(ConfigurationManager.AppSettings[InputData.DropZone]);
            var outputZone = DirectorySetup.GetPath(ConfigurationManager.AppSettings[InputData.OutputZone]);
            var program    = DirectorySetup.GetPath(ConfigurationManager.AppSettings[InputData.BlackBoxProgram]);
            var command    = $"\" java -jar  \"{program}\"   \"{dropZone}\"  \"{outputZone}\"\"";
            var execution  = new CommandExecution();

            ScenarioContext.Current[ContextKey.Log] = execution.Execute(command, true);
        }
コード例 #6
0
        public void ThenChartHasBeenDisplayed(string elementId)
        {
            var url    = ConfigurationManager.AppSettings[InputData.Url];
            var driver = new ChromeDriver(DirectorySetup.GetPath(ConfigurationManager.AppSettings[InputData.Drivers]));

            driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(10);
            driver.Navigate().GoToUrl(url);
            Assert.IsTrue(driver.FindElement(By.Id(elementId)).Displayed, $"The page {url} wasn't loaded correctly, please check");
            ScenarioContext.Current[ContextKey.Driver] = driver;
        }
コード例 #7
0
ファイル: FileInfoEx.cs プロジェクト: J0nnyI/TableTopCrucible
        public FileInfoEx(DirectorySetup directorySetup, FileInfo fileInfo)
        {
            if (directorySetup.Id != fileInfo.DirectorySetupId)
            {
                throw new InvalidOperationException($"{nameof(FileInfoEx)} tried to link dirSetup {directorySetup.Id} with fileInfo {fileInfo} with the dirSetupId {fileInfo.DirectorySetupId}");
            }

            FileInfo       = fileInfo;
            DirectorySetup = directorySetup;
            AbsoluteUri    = new Uri(directorySetup.Path, fileInfo.Path);
        }
コード例 #8
0
        public void ThenPageTitleHasBeenDisplayed(string title)
        {
            var url    = ConfigurationManager.AppSettings[InputData.Url];
            var driver = new ChromeDriver(DirectorySetup.GetPath(ConfigurationManager.AppSettings[InputData.Drivers]));

            driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(10);

            driver.Navigate().GoToUrl(url);
            Thread.Sleep(200);

            Assert.AreEqual(title, driver.FindElement(By.XPath("/html/body/h1")).Text, $"The page {url} wasn't loaded correctly, the title is incorrect , please check");
            ScenarioContext.Current[ContextKey.Driver] = driver;
        }
コード例 #9
0
        public FileInfo?UpdateFile(DirectorySetup dirSetup, Uri relativePath)
        {
            var localPath = new Uri(dirSetup.Path, relativePath).LocalPath;
            var fileInfo  = new SysFileInfo(localPath);

            return(this.fileDataService.Patch(
                       new FileInfoChangeset()
            {
                Path = relativePath,
                CreationTime = fileInfo.CreationTime,
                FileHash = fileManagementService.HashFile(localPath),
                DirectorySetupId = dirSetup.Id,
                FileSize = fileInfo.Length,
                IsAccessible = File.Exists(localPath),
                LastWriteTime = fileInfo.LastWriteTime
            }));
        }
コード例 #10
0
        public void WhenNodeServerIsStarted()
        {
            var nodeServer  = ConfigurationManager.AppSettings[InputData.UIServer];
            var command     = $"cd {DirectorySetup.GetPath(ConfigurationManager.AppSettings[InputData.UIServerFolder])} & node {nodeServer}";
            var execution   = new CommandExecution();
            var portCorrect = int.TryParse(ConfigurationManager.AppSettings[InputData.Port], out int port);
            var host        = ConfigurationManager.AppSettings[InputData.Host];

            if (!ServiceCheck.IsListening(host, port))
            {
                ScenarioContext.Current[ContextKey.Log] = execution.Execute(command, false);
            }
            else
            {
                Assert.Fail("The server is already running");
            }
        }
コード例 #11
0
        public async Task <IHttpActionResult> Config(DirectorySetup setup)
        {
            using (var context = new AdContext())
            {
                if (setup.Id == default(int))
                {
                    context.DirectorySetups.Add(setup);
                }
                else
                {
                    var data = context.DirectorySetups.Find(setup.Id);
                    if (data != null)
                    {
                        data.DomainName      = setup.DomainName;
                        data.IpAddress       = setup.IpAddress;
                        data.ServiceUserName = setup.ServiceUserName;
                        data.ServicePassword = setup.ServicePassword;
                    }
                }
                await context.SaveChangesAsync();

                return(Ok(new { state = true, message = "setup successful" }));
            }
        }
コード例 #12
0
 public DirSetupFile(string path, DirectorySetup dirSetup)
 {
     Path     = path ?? throw new ArgumentNullException(nameof(path));
     DirSetup = dirSetup;
 }
コード例 #13
0
 public DirectorySetupDTO(DirectorySetup source) : base(source)
 {
     this.Path        = source.Path;
     this.Name        = (string)source.Name;
     this.Description = (string)source.Description;
 }
コード例 #14
0
ファイル: ScenarioTests.cs プロジェクト: tobin5/MyMoney.Net
        private void SetDirectoryPermissions()
        {
            string dir = TestContext.TestDeploymentDir;

            DirectorySetup.AddWritePermission("NT AUTHORITY\\NETWORK SERVICE", dir);
        }
コード例 #15
0
 public DirectorySetupSavedEventArgs(DirectorySetup directorySetup)
 {
     this.DirectorySetup = directorySetup;
 }
コード例 #16
0
 public LocalFile(DirectorySetup directorySetup, string localPath)
 {
     DirectorySetup = directorySetup;
     FileInfo       = new SysFileInfo(localPath);
 }
コード例 #17
0
        public void ThenOutputFileIsNotEmpty()
        {
            string outputFile = DirectorySetup.GetPath(ConfigurationManager.AppSettings[InputData.OutputFilePath]);

            Assert.AreNotEqual(0, new FileInfo(outputFile).Length, "The file exist, but it is empty");
        }
コード例 #18
0
 private IEnumerable <LocalFile> getLocalFiles(DirectorySetup directorySetup)
 {
     return(Directory.GetFiles(directorySetup.Path.LocalPath, "*", SearchOption.AllDirectories)
            .Select(file => new LocalFile(directorySetup, file)));
 }
コード例 #19
0
 public void AddWritePermission(string accountName, string path)
 {
     DirectorySetup.AddWritePermission(accountName, path);
 }
コード例 #20
0
        public void ThenTheOutputFileHasBeenCreated()
        {
            var outputFile = DirectorySetup.GetPath(ConfigurationManager.AppSettings[InputData.OutputFilePath]);

            Assert.IsTrue(File.Exists(outputFile), "Something wrong, the output file haven't been created");
        }