public void Initialize() { decrypter = MockRepository.GenerateMock<ICaesarShiftDecrypter>(); observableText = MockRepository.GenerateMock<IObservableText>(); target = new CaesarShiftSetupViewModel(decrypter, observableText); }
public MonoAlphaSetupViewModel(IDecrypter decrypter, IObservableText encryptedText) { this.decrypter = decrypter; this.encryptedText = encryptedText; LoadSampleTextCommand = new SimpleDelegateCommand(LoadSampleText); encryptedText.TextChanged += OnEncryptedTextChanged; }
public XORKeyFinder(IObservableText encryptedText, ITextHelper textChecker, byte lowerKeyBound, byte upperKeyBound, params string[] wordsToFind) { this.encryptedText = encryptedText; this.textChecker = textChecker; this.lowerKeyBound = lowerKeyBound; this.upperKeyBound = upperKeyBound; this.wordsToFind = wordsToFind; }
public void Initialize() { encryptedText = MockRepository.GenerateMock<IObservableText>(); decryptedText = MockRepository.GenerateMock<IDecryptedText>(); SetupDecrypterAndViewModelTuples(4); target = new DecrypterViewModel(encryptedText, decryptedText, decryptersAndViewModels); }
public DecrypterViewModel(IObservableText encryptedText, IDecryptedText decryptedText, params Tuple<IDecrypter, IDecryptionSetupViewModel>[] decryptionAlgorithmsVMPairs) { this.encryptedText = encryptedText; this.decryptedText = decryptedText; encryptedText.TextChanged += (s, e) => OnPropertyChanged("EncryptedText"); decryptedText.TextChanged += (s, e) => OnPropertyChanged("DecryptedText"); InitialiseDecryptersAndViewModels(decryptionAlgorithmsVMPairs); }
public void Initialize() { encryptedText = MockRepository.GenerateMock<IObservableText>(); decrypter = MockRepository.GenerateMock<IDecrypter>(); target = new DecryptedText(encryptedText); target.CurrentDecrypter = decrypter; }
public CaesarShiftSetupViewModel(ICaesarShiftDecrypter decrypter, IObservableText encryptedText) { this.decrypter = decrypter; this.encryptedText = encryptedText; ShiftUpCommand = new SimpleDelegateCommand(() => Shift++); ShiftDownCommand = new SimpleDelegateCommand(() => Shift--); LoadSampleTextCommand = new SimpleDelegateCommand(LoadSampleText); }
public void Initialize() { encryptedText = MockRepository.GenerateMock<IObservableText>(); textChecker = MockRepository.GenerateMock<ITextHelper>(); wordsToFind = new string[] { "one", "two", "three" }; testKey = new byte[] { 10, 10, 10 }; keysTried = new List<byte[]>(); target = new XORKeyFinder(encryptedText, textChecker, lowerKeyBound, upperKeyBound, wordsToFind); }
public XORDecrypter( IObservableText encryptedText, ITextHelper textChecker, IXORKeyFinderFactory xorKeyFinderFactory, params byte[] key) { this.encryptedText = encryptedText; this.textHelper = textChecker; this.xorKeyFinderFactory = xorKeyFinderFactory; Key = key; }
public void Initialize() { encryptedText = MockRepository.GenerateMock<IObservableText>(); textHelper = MockRepository.GenerateMock<ITextHelper>(); xorKeyFinderFactory = MockRepository.GenerateMock<IXORKeyFinderFactory>(); xorKeyFinder = MockRepository.GenerateMock<IXORKeyFinder>(); xorKeyFinderFactory.Stub(x => x.Create(null, null, 0, 0)).IgnoreArguments().Return(xorKeyFinder); target = new XORDecrypter(encryptedText, textHelper, xorKeyFinderFactory); }
public XORSetupViewModel(IXORDecrypter decrypter, IObservableText encryptedText) { this.decrypter = decrypter; this.encryptedText = encryptedText; FindKeyCommand = new SimpleDelegateCommand(FindKey); LoadSampleTextCommand = new SimpleDelegateCommand(LoadSampleText); decrypter.KeyChanged += HandleKeyChanged; KeyAutoSearchLowerBound = 97; KeyAutoSearchUpperBound = 122; WordsToFind = string.Empty; }
public DecryptedText(IObservableText encryptedText) { this.encryptedText = encryptedText; encryptedText.TextChanged += HandleEncryptedTextChanged; }
public IXORKeyFinder Create(IObservableText encryptedText, ITextHelper textChecker, byte lowerKeyBound, byte upperKeyBound, params string[] wordsToFind) { return new XORKeyFinder(encryptedText, textChecker, lowerKeyBound, upperKeyBound, wordsToFind); }