public void GetContentsOfTagTest()
        {
            Ea.TestName = "GetContentsOfTagTest";

            string value = Ea.GetContentsOfTag("body");

            Console.WriteLine(value);
            Assert.IsTrue(value.Length > 0);
        }
        public void GetTextFromElementByIdTest()
        {
            Ea.TestName = "GetTextFromElementByIdTest";
            Ea.GoToAnotherPage($"{MainUrl}/Pages/Sitemap.aspx");
            string value = Ea.GetTextFromElementById("MainContent_TreeView1t5", out var err);

            if (err?.Length > 0)
            {
                TestContext.WriteLine(err);
            }
            TestContext.WriteLine($"{value}");
            Assert.IsTrue(value.Length > 0);
        }
        public void LinkIsPresentByIdTest()
        {
            Ea.TestName = "LinkIsPresentByIdTest";
            Ea.GoToAnotherPage($"{MainUrl}/Pages/Software_OpenSource.aspx");
            bool value = Ea.LinkIsPresentById("MainContent_TreeView1t2", out var err);

            if (err?.Length > 0)
            {
                TestContext.WriteLine(err);
            }
            TestContext.WriteLine($"{value}");
            Assert.IsTrue(value);
        }
        public void NumberOfExpectedLinksTest()
        {
            Ea.TestName = "NumberOfExpectedLinksTest";
            Ea.GoToAnotherPage($"{MainUrl}/Pages/Software_OpenSource.aspx");
            bool value = Ea.NumberOfExpectedLinks("My Gun Collection", out var err);

            if (err?.Length > 0)
            {
                TestContext.WriteLine(err);
            }
            TestContext.WriteLine($"{value}");
            Assert.IsTrue(value);
        }
Esempio n. 5
0
        public MainWindowViewModel(DatabaseContext dc, IEventAggregator ea, IRegionManager regionManager) : base(dc, ea)
        {
            // Registering Regions
            regionManager.RegisterViewWithRegion("SalesRegion", typeof(Sales));
            regionManager.RegisterViewWithRegion("CashRegion", typeof(Cash));
            regionManager.RegisterViewWithRegion("ArticlesRegion", typeof(Articles));
            regionManager.RegisterViewWithRegion("ReportRegion", typeof(Report));

            Ea.GetEvent <ValidationEvent>().Subscribe(ValidationEventHandler);

            AboutCommand = new DelegateCommand(ShowAboutMessage);
            SaveCommand  = new DelegateCommand(OnSave, CanSave);
            ExitCommand  = new DelegateCommand(OnExit);

            //Dc.ChangeTracker.StateChanged += StateChangedHandler;
        }
        public void CheckPublic()
        {
            Ea.TestName = "PublicUI";

            Ea.WaitTillElementFound("//ul[@id='jetmenu']/li[3]/a", GeneralActions.FindBy.XPath, GeneralActions.MyAction.Click);
            Ea.WaitTillElementFound("My Gun Collection", GeneralActions.FindBy.LinkText, GeneralActions.MyAction.Click);
            Ea.WaitTillElementFound("//ul[@id='jetmenu']/li[3]/a", GeneralActions.FindBy.XPath, GeneralActions.MyAction.Click);
            Ea.WaitTillElementFound("My Loaders Log", GeneralActions.FindBy.LinkText, GeneralActions.MyAction.Click);
            Ea.WaitTillElementFound("//ul[@id='jetmenu']/li[3]/a", GeneralActions.FindBy.XPath, GeneralActions.MyAction.Click);
            Ea.WaitTillElementFound("File Renamer Utility", GeneralActions.FindBy.LinkText, GeneralActions.MyAction.Click);
            Ea.WaitTillElementFound("//ul[@id='jetmenu']/li[3]/a", GeneralActions.FindBy.XPath, GeneralActions.MyAction.Click);
            Ea.WaitTillElementFound("BurnPad", GeneralActions.FindBy.LinkText, GeneralActions.MyAction.Click);
            Ea.WaitTillElementFound("//ul[@id='jetmenu']/li[7]/a", GeneralActions.FindBy.XPath, GeneralActions.MyAction.Click);
            Ea.WaitTillElementFound("Contact", GeneralActions.FindBy.LinkText, GeneralActions.MyAction.Click);
            Ea.WaitTillElementFound("MainContent_txtName", GeneralActions.FindBy.Id, GeneralActions.MyAction.SendKeys, "Jimmy Pop Corn");
            Ea.FindElements("MainContent_txteMail", GeneralActions.FindBy.Id, GeneralActions.MyAction.SendKeys, "*****@*****.**");
            Ea.FindElements("MainContent_txtMsg", GeneralActions.FindBy.Id, GeneralActions.MyAction.SendKeys, "Make software great again!");
            Ea.FindElements("MainContent_btnSend", GeneralActions.FindBy.Id, GeneralActions.MyAction.Click);
            Ea.WaitTillElementFound("MainContent_Label4", GeneralActions.FindBy.Id, GeneralActions.MyAction.Nothing);
        }
Esempio n. 7
0
        public CashViewModel(DatabaseContext db, IEventAggregator ea) : base(db, ea)
        {
            Ea.GetEvent <DateSelectedChangedEvent>().Subscribe(DateSelectedChangedHandler);

            Sales    = Dc.Sales.Local.ToObservableCollection();
            Deposits = Dc.Deposits.Local.ToObservableCollection();

            DepositsCollectionView                 = CollectionViewSource.GetDefaultView(Deposits);
            DepositsCollectionView.Filter         += new Predicate <object>(DepositsViewFilterHandler);
            DepositsCollectionView.CurrentChanged += DepositsCollectionView_CurrentChanged;

            CreateSaleDailyCollection(SalesDaily, Sales);
            SalesDailyCollectionView         = CollectionViewSource.GetDefaultView(SalesDaily);
            SalesDailyCollectionView.Filter += new Predicate <object>(SalesDailyViewFilterHandler);

            // DEPOSITS
            // 1. register for PropertyChanged event for all existing items in Deposits
            foreach (var item in Deposits)
            {
                item.PropertyChanged += Deposit_PropertyChanged;
            }

            // 2. for all items which are going to be removed or added to Deposits
            Deposits.CollectionChanged += Deposits_CollectionChanged;

            // ORDERS
            // 1. register for PropertyChanged event for all existing items in Orders
            foreach (var item in Sales)
            {
                item.PropertyChanged += Sale_PropertyChanged;
            }

            // 2. for all items which are going to be removed or added to Orders
            Sales.CollectionChanged += Sales_CollectionChanged;

            AddNewDepositCommand = new DelegateCommand(AddNewDeposit);
            RemoveDepositCommand = new DelegateCommand <object>(RemoveDeposit, CanRemoveDeposit);
        }
 public void Close()
 {
     Ea.Dispose();
 }
Esempio n. 9
0
        public static Result <domain.Day> create_day
            (IEnumerable <DataAttribute> attributes)
        {
            var errors  = new List <ResultError>();
            var summary = string.Empty;

            time.Date date  = null;
            var       diary = Enumerable.Empty <domain.DiaryEntry>();

            var create_day = (Func <domain.Day>)(() => new domain.Day(
                                                     summary
                                                     , date
                                                     , diary
                                                     ));

            attributes
            .value_for(
                "summary"
                , error: () => new SummarySerialisationError()
                )
            .match(
                success: value => summary = value
                , error: errs => errors.AddRange(errs)
                )
            ;

            attributes
            .collection_for(
                "date"
                , error: () => new DateSerialisationError()
                )
            .bind(collection => time.serialisation.Date.create_date(collection))
            .match(
                success: d => date = d
                , error: errs => errors.AddRange(errs)
                );

            attributes
            .collection_for(
                "diary"
                , error: () => new DiarySerialisationError()
                )
            // I. This does not handled failures in create_diary entry this has multiple otions and will need to be dealt with.
            .bind(EEa =>



                  EEa
                  .Select((Ea, i) => {
                return
                (DiaryEntry.create_diary_entry(



                     Ea
                     .match(s => default(IEnumerable <DataAttribute>),
                            ca => ca)



                     ));
            })
                  .Aggregate(
                      new AggregatedDiaryEntryResults()
                      , (acc, Re) => acc.add_result(Re)
                      )
                  .fmap(acc => acc.result())


                  )
            .match(
                success: diary_entries => diary = diary_entries
                , error: errs => errors.AddRange(errs)
                );

            /*
             *
             *      public static TSource Aggregate<TSource>(
             *            this IEnumerable<TSource> source
             *           ,Func<TSource, TSource, TSource> func
             *      );
             *      public static TAccumulate Aggregate<TSource, TAccumulate>(
             *           this IEnumerable<TSource> source
             *          ,TAccumulate seed
             *          ,Func<TAccumulate, TSource, TAccumulate> func
             *      );
             *      public static TResult Aggregate<TSource, TAccumulate, TResult>(
             *           this IEnumerable<TSource> source
             *          ,TAccumulate seed
             *          ,Func<TAccumulate, TSource, TAccumulate> func
             *          ,Func<TAccumulate, TResult> resultSelector
             *      );
             *
             */

            return(!errors.Any()
                 ? Result <domain.Day> .success(create_day())
                 : Result <domain.Day> .error(errors)
                   );
        }