예제 #1
0
        public IViewComponentResult Invoke()
        {
            var model = new ToastNotificationViewModel()
            {
                ToastMessages    = _tempDataWrapper.Get <IEnumerable <ToastMessage> >(Constants.TempDataKey),
                GlobalOptionJson = _globalOption.MergeWith(ToastOption.Defaults).Json
            };

            return(View("ToastrView", model));
        }
예제 #2
0
        public IViewComponentResult Invoke()
        {
            var model = new ToastNotificationViewModel()
            {
                ToastMessagesJson = _toastNotification.ReadAllMessages().ToJson(),
                GlobalOptionJson  = _globalOption.MergeWith(ToastOption.Defaults).Json,
                RequestHeaderKey  = Constants.RequestHeaderKey,
                LibraryName       = _nToastNotifyOption.Library.ToString().ToLower()
            };

            return(View("ToastrView", model));
        }
예제 #3
0
        public void MergeWith_ValidArguments_ReturnMergedObject()
        {
            //Arrange
            var obj1 = new ToastOption()
            {
                PositionClass = "primary"
            };
            var obj2 = new ToastOption()
            {
                CloseClass = "Close"
            };

            //Act
            obj2.MergeWith(obj1);

            //Assert
        }