Beispiel #1
0
            public void WithdrawSentRequest()
            {
                test = extent.StartTest("Request Sent Test");
                Profile proObj = new Profile();

                proObj.SentRequestsSteps();
                SentRequests sentReqObj = new SentRequests();

                sentReqObj.WithdrawSentRequest();

                try
                {
                    string ExpectedUpdateMsg = "Request has been withdrawn";
                    GlobalDefinitions.wait(20);

                    string ActualMsg = proObj.LangAddedSuccessMsg.Text;
                    GlobalDefinitions.wait(10);

                    Assert.AreEqual(ExpectedUpdateMsg, ActualMsg);
                    test.Log(LogStatus.Pass, "Test Pass: Request Withdrwn successfully");
                    GlobalDefinitions.SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "Request Withdraw");

                    Console.WriteLine(ExpectedUpdateMsg);
                }

                catch (NoSuchElementException)
                {
                    Console.Write("Element not found");
                }
            }
Beispiel #2
0
 public async Task ClearSentRequests()
 {
     CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         SentRequests.Clear();
     });
 }
Beispiel #3
0
 public async Task RemoveSentRequest(Guid requestId)
 {
     CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         var toRemove = SentRequests.FirstOrDefault(r => r.Id == requestId);
         SentRequests.Remove(toRemove);
     });
 }
Beispiel #4
0
        public async Task AddSentRequests(IEnumerable <FriendRequestDto> sentRequests)
        {
            await ClearSentRequests();

            CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                foreach (var request in sentRequests)
                {
                    SentRequests.Add(request);
                }
            });
        }
Beispiel #5
0
        public ActionResult Choose(string UId, string CoId, string StId)
        {
            var currentUser = unitOfWork.ActiveUserRepository.GetByID(WebSecurity.CurrentUserId);
            var allRequests = currentUser.PlanRequests.Concat(currentUser.PlanRequestsForUserPlan)
                              .Where(r => r.payment == null || r.approve == false);
            SentRequests resuls = new SentRequests();

            resuls.RequestsFoNew  = allRequests.Where(r => r is RequestForNew).Select(g => (RequestForNew)g);
            resuls.RevialRequests = allRequests.Where(r => r is RevivalRequest).Select(g => (RevivalRequest)g);
            resuls.CoId           = CoId;
            resuls.StId           = StId;
            resuls.UId            = UId;
            return(View(resuls));
        }
Beispiel #6
0
 public bool HasRequest <TRequest>() where TRequest : Request
 {
     return(SentRequests.Any(r => r.GetType().Equals(typeof(TRequest))));
 }
Beispiel #7
0
 public TRequest GetRequest <TRequest>() where TRequest : Request
 {
     return((TRequest)SentRequests.First(r => r.GetType().Equals(typeof(TRequest))));
 }