public void DelegatesControlToStringEncryptor()
        {
            var request = new EncryptForLocalMachineScopeRequest {
            StringToEncrypt = "The user data",
            Purposes = new[] {"My", "Purposes"}
              };
              const string expectedResult = "{Cypher}";
              ConfigureStringEncryptor_ToReturn(expectedResult);

              var actual = _sut.Handle(request).Result;

              Assert.That(actual, Is.Not.Null);
              Assert.That(actual, Is.EqualTo(expectedResult));
              A.CallTo(() => _localMachineScopeStringEncryptor.Encrypt(request.StringToEncrypt, request.Purposes))
               .MustHaveHappened();
        }
        public void EncryptsUserData()
        {
            _sut.StringToEncrypt = "The string to encrypt!";
              _sut.Purposes = new[] {"My", "Purposes"};
              var expectedRequest = new EncryptForLocalMachineScopeRequest {
            StringToEncrypt = _sut.StringToEncrypt,
            Purposes = _sut.Purposes
              };

              const string expectedResult = "{EncryptedString}";
              ConfigureQueryHandler_ToReturn(expectedResult);

              var result = _sut.Execute();
              var actual = _sut.EncryptedString;

              Assert.That(result, Is.True);
              Assert.That(actual, Is.Not.Null);
              Assert.That(actual, Is.EqualTo(expectedResult));
              A.CallTo(() => _encryptForLocalMachineScopeQueryHandler.Handle(
            A<EncryptForLocalMachineScopeRequest>.That.Matches(req => req.HasSamePropertyValuesAs(expectedRequest))))
               .MustHaveHappened();
        }