public void HashValidatorShouldBeDeterministic() { var rootPath = Path.Combine(currentDir, "CoreTestDirectory"); var hashValidator = new HashValidator(options, rootPath); hashValidator.RegenerateHashes(pathConverterList); Assert.IsTrue(hashValidator.IsHashValid(pathConverterList)); }
public CheckPasswordForm() { InitializeComponent(); Opacity = 0; this.panelHeader.BackColor = Settings.UI.ColorAccent; this.panelPasswordTextbox.BackColor = Settings.UI.TextBoxFocusColor; this.ValidLogin = false; this.validator = new HashValidator(); Animation.FadeIn(this); }
public void When_Informed_A_Valid_XML_File_Must_Return_A_Valid_Hash() { var repository = new XMLRepository(); foreach (var file in repository.GetXMLFiles()) { var result = HashValidator.ValidateHash(file.Content); Assert.True(result.CalculatedHash.ToUpper() == result.ReportedHash.ToUpper(), $"File: {file.Name}. Reported hash: {result.ReportedHash}. Calculated hash: {result.CalculatedHash}."); } }
private void Validate(string name, ModuleInfo module, string basePath, IProgress <double> progress, CancellationToken token) { if (string.IsNullOrEmpty(name)) { ThrowValidationException("Missing module name"); } Func <string> formatter = () => string.Format("module {0}", name); if (module == null) { ThrowValidationException("Null {0}", formatter); } ValidateCreated(module.Created, formatter); ValidateChangeset(module.Changeset, formatter); HashValidator.Validate(module.Hash, basePath, progress, token); }