public FilePatch(bool isUpdate, DirectorySetup directorySetup, SysFileInfo fileInfo, FileHash hash) { IsUpdate = isUpdate; DirectorySetup = directorySetup; FileInfo = fileInfo; Hash = hash; }
public void GivenTheOutputFolderIsEmpty() { var outputZone = DirectorySetup.GetPath(ConfigurationManager.AppSettings[InputData.OutputZone]); DirectoryInfo directoryInfo = new DirectoryInfo(outputZone); directoryInfo.Empty(); }
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"); }
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"); }
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); }
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; }
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); }
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; }
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 })); }
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"); } }
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" })); } }
public DirSetupFile(string path, DirectorySetup dirSetup) { Path = path ?? throw new ArgumentNullException(nameof(path)); DirSetup = dirSetup; }
public DirectorySetupDTO(DirectorySetup source) : base(source) { this.Path = source.Path; this.Name = (string)source.Name; this.Description = (string)source.Description; }
private void SetDirectoryPermissions() { string dir = TestContext.TestDeploymentDir; DirectorySetup.AddWritePermission("NT AUTHORITY\\NETWORK SERVICE", dir); }
public DirectorySetupSavedEventArgs(DirectorySetup directorySetup) { this.DirectorySetup = directorySetup; }
public LocalFile(DirectorySetup directorySetup, string localPath) { DirectorySetup = directorySetup; FileInfo = new SysFileInfo(localPath); }
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"); }
private IEnumerable <LocalFile> getLocalFiles(DirectorySetup directorySetup) { return(Directory.GetFiles(directorySetup.Path.LocalPath, "*", SearchOption.AllDirectories) .Select(file => new LocalFile(directorySetup, file))); }
public void AddWritePermission(string accountName, string path) { DirectorySetup.AddWritePermission(accountName, path); }
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"); }