コード例 #1
0
ファイル: NotifierTest.cs プロジェクト: iuryferreira/notie
        public void Clear_ShouldRemoveAllNotifications()
        {
            _sut = new Notifier();
            List <Notification> notifications = new() { new("any_key", "any_message"), new("any_key", "any_message") };

            _sut.AddNotifications(notifications);
            _sut.Clear();
            Assert.False(_sut.HasNotifications());
        }
コード例 #2
0
        protected bool IsValid()
        {
            if (_notifier.HasNotifications())
            {
                foreach (var erro in _notifier.GetNotifications())
                {
                    _toastNotification.AddErrorToastMessage(erro.Message);
                }

                return(false);
            }

            return(true);
        }
コード例 #3
0
 protected bool ValidOperation()
 {
     return(!_notifier.HasNotifications());
 }
コード例 #4
0
 protected bool IsOperationValid()
 {
     return(!_notifier.HasNotifications());
 }
コード例 #5
0
 protected bool OperacaoValida() => !_notifier.HasNotifications();
コード例 #6
0
ファイル: NotifierTest.cs プロジェクト: iuryferreira/notie
 public void HasNotifications_MustReturnFalse_NoNotificationIsAdded()
 {
     _sut = new Notifier();
     Assert.False(_sut.HasNotifications());
 }
コード例 #7
0
ファイル: NotifierTest.cs プロジェクト: iuryferreira/notie
 public void HasNotifications_MustReturnTrue_AnyNotificationIsAdded()
 {
     _sut = new Notifier();
     _sut.AddNotification(new("any_key", "any_message"));
     Assert.True(_sut.HasNotifications());
 }
コード例 #8
0
 protected bool OperacaoValida()
 {
     return(!_notifier.HasNotifications());
 }