public override void Execute(object parameter) { var vm = (TextHashingViewModel)parameter; var hasher = new Md5HashGenerator(); vm.Checksum = hasher.Hash(vm.Message); }
public override void Execute(object parameter) { var vm = (FileHashingViewModel)parameter; var hasher = new Md5HashGenerator(); vm.GeneratedChecksum = hasher.Hash(new BinaryReader(File.OpenRead(vm.FilePath))); }
public void Hash_Positive_ReturnsHash(string input, string expected) { var actual = _generator.Hash(input); Assert.Equal(expected, actual); }