Esempio n. 1
0
        public void HandleInteractionObjectchanged_CallsRaisePropertyChanged()
        {
            var propertyList = new List <string>();

            _viewModel.PropertyChanged += (sender, args) => propertyList.Add(args.PropertyName);
            _viewModel.ContentTokenViewModel.PropertyChanged += (sender, args) => propertyList.Add(args.PropertyName);

            _viewModel.SetInteraction(_interaction);

            Assert.Contains(nameof(_viewModel.ContentTokenViewModel), propertyList);
            Assert.Contains(nameof(_viewModel.SubjectTokenViewModel), propertyList);
            Assert.Contains(nameof(_viewModel.AddSignature), propertyList);
            Assert.Contains(nameof(_viewModel.Interaction), propertyList);
            Assert.Contains(nameof(_viewModel.ContentTokenViewModel.Text), propertyList);
        }
Esempio n. 2
0
        public void SetUp()
        {
            _interaction = new EditEmailTextInteraction("Subject", "Content", false, false);

            var translationUpdater = Substitute.For <ITranslationUpdater>();

            _translation = new SmtpTranslation();

            var mailSignatureHelper = Substitute.For <IMailSignatureHelper>();

            mailSignatureHelper.ComposeMailSignature().Returns(TestSignature);

            _tokenHelper   = new TokenHelper(new DesignTimeTranslationUpdater());
            _tokenReplacer = _tokenHelper.TokenReplacerWithPlaceHolders;

            _viewModel = new EditEmailTextViewModel(translationUpdater, mailSignatureHelper, _tokenHelper);
            _viewModel.SetInteraction(_interaction);
        }