Ejemplo n.º 1
0
        public void SearchCustomerByNameShouldReturnProfile()
        {
            // arrange
            List <CProduct> supply = new List <CProduct>
            {
                new CProduct("111", "Banana", "Produce", 0.5, 10),
                new CProduct("222", "orange", "Produce", 0.88, 10)
            };
            List <CProduct> p = new List <CProduct> {
                new CProduct("111", "Banana", "Produce", 0.5, 4),
                new CProduct("222", "orange", "Produce", 0.88, 4)
            };
            CStore    store    = new CStore("Phoenix101", "606", supply);
            CCustomer customer = new CCustomer("123123121", "John", "Smith", "6021111111");

            COrder order = new COrder(store, customer, DateTime.Today, 100, p);

            customer.PlaceOrder(store, order);
            ISearch searchTool = new SimpleSearch();
            // act
            string customerid;
            bool   result = searchTool.SearchByName(store, "John", "Smith", out customerid);


            // assert
            Assert.True(result);
        }
Ejemplo n.º 2
0
        public void Test_Easy_Square_BFS()
        {
            IState init = new Square(new[] { 1, 4, 2, 3, 5, 8, 6, 0, 7 });
            Console.WriteLine(init);
            SimpleSearch bfs = new SimpleSearch(new BreadthFirstSearch());
            var solution = bfs.Find(init);

            if (solution) PrintSolution(bfs.Solution);
            Assert.IsTrue(solution);
        }
Ejemplo n.º 3
0
        private SearchDto AddSearchLink(SimpleSearch elem)
        {
            elem.Tconst = elem.Tconst.Trim();

            var dto = _mapper.Map <SearchDto>(elem);

            dto.Link = Url.Link(nameof(TitlesController.GetMovie), new { elem.Tconst });

            return(dto);
        }
Ejemplo n.º 4
0
        private void btnAllSharesGo_Click(object sender, EventArgs e)
        {
            foreach (var s in this.symbols)
            {
                Price[] data = HistoricalPriceReader.Convert(this.GetShareData(s), this.GetSplitData(s)).ToArray();

                SimpleSearch search = new SimpleSearch();
                search.Process(data, this.simpleSearchSettings);
                var results = search.Results;
            }
        }
Ejemplo n.º 5
0
        public void Test_Hard_AStar()
        {
            IState init = new Square(new[] { 1, 2, 3, 4, 5, 6, 7, 0, 8 });

            AStarSearch strategy = new AStarSearch();

            var a = new SimpleSearch<IState, ISuccessor>(strategy);
            var solution = a.Find(init);
            if (solution) PrintSolution(a.Solution);
            Assert.True(solution);
        }
Ejemplo n.º 6
0
        public void should_return_zero_hits_when_search_for_findwise1()
        {
            // Arrange
            var simpleSearch = new SimpleSearch();

            simpleSearch.UpdateIndex(null, 1);

            // Act
            List <DocumentRatio> result = simpleSearch.Search("findwise");

            // Assert
            Assert.AreEqual(0, result.Count);
        }
Ejemplo n.º 7
0
        public void Test_Easy_Square_BFS()
        {
            IState init = new Square(new[] { 1, 4, 2, 3, 5, 8, 6, 0, 7 });

            Console.WriteLine(init);
            var bfs      = new SimpleSearch <IState, ISuccessor>(new BreadthFirstSearch());
            var solution = bfs.Find(init);

            if (solution)
            {
                PrintSolution(bfs.Solution);
            }
            Assert.True(solution);
        }
        public void BinarySearchTest()
        {
            var data = new int[10000];

            for (int i = 0; i < data.Length; i++)
            {
                data[i] = i;
            }
            var searcher = new SimpleSearch();

            Assert.IsTrue(searcher.BinarySearch(data, 0));
            Assert.IsTrue(searcher.BinarySearch(data, 9999));
            Assert.IsFalse(searcher.BinarySearch(data, 10000));
        }
Ejemplo n.º 9
0
        public void Test_Hard_AStar()
        {
            IState init = new Square(new[] { 1, 2, 3, 4, 5, 6, 7, 0, 8 });

            AStarSearch strategy = new AStarSearch()
            {
                Heuristic = s => s.Heuristic()
            };

            SimpleSearch a = new SimpleSearch(strategy);
            var solution = a.Find(init);
            if (solution) PrintSolution(a.Solution);
            Assert.IsTrue(solution);
        }
Ejemplo n.º 10
0
        private void btnSimpleSearchGentics_Click(object sender, EventArgs e)
        {
            SimpleSearchSettings currentSettings = new SimpleSearchSettings(), bestSettings;
            int    currentFailedSells, bestFailedSells;
            int    currentOkSells, bestOkSells;
            Random rnd = new Random();
            string symbol = cbSelectSymbol.SelectedItem as string;

            Price[] data = HistoricalPriceReader.Convert(this.GetShareData(symbol), this.GetSplitData(symbol)).ToArray();

            bestSettings = this.simpleSearchSettings;

            SimpleSearch search = new SimpleSearch();

            search.Process(data, this.simpleSearchSettings);
            var results = search.Results;

            bestFailedSells = results.Count(r => r.Last().state == ResultState.FailedFindingSellPoint);
            bestOkSells     = results.Count(r => r.Last().state == ResultState.OK);

            for (int c = 365; c > 0; c--)
            {
                currentSettings.fallSearchPeriodInDays = rnd.Next(1, c);
                currentSettings.riseSearchPeriodInDays = rnd.Next(1, c);
                currentSettings.requiredChangeRate     = rnd.Next(1, c);
                currentSettings.numerOfRepeats         = this.simpleSearchSettings.numerOfRepeats;

                search.Process(data, currentSettings);
                results = search.Results;

                currentFailedSells = results.Count(r => r.Last().state == ResultState.FailedFindingSellPoint);
                currentOkSells     = results.Count(r => r.Last().state == ResultState.OK);

                if (currentOkSells > 0 && (currentFailedSells < bestFailedSells || (currentFailedSells == bestFailedSells && currentOkSells > bestOkSells)))
                {
                    bestSettings    = (SimpleSearchSettings)currentSettings.Clone();
                    bestFailedSells = currentFailedSells;
                    bestOkSells     = currentOkSells;
                }
            }

            tbFallSearchPeriod.Text = bestSettings.fallSearchPeriodInDays.ToString();
            tbRiseSearchPeriod.Text = bestSettings.riseSearchPeriodInDays.ToString();
            tbRateChange.Text       = bestSettings.requiredChangeRate.ToString();
            tbRepeats.Text          = bestSettings.numerOfRepeats.ToString();

            search.Process(data, bestSettings);
            DisplaySimpleSearchResults(search.Results);
        }
Ejemplo n.º 11
0
        public void Test_Hard_AStar()
        {
            IState init = new Square(new[] { 1, 2, 3, 4, 5, 6, 7, 0, 8 });

            AStarSearch strategy = new AStarSearch();

            var a        = new SimpleSearch <IState, ISuccessor>(strategy);
            var solution = a.Find(init);

            if (solution)
            {
                PrintSolution(a.Solution);
            }
            Assert.True(solution);
        }
Ejemplo n.º 12
0
        public void should_return_one_hit_when_search_for_findwise()
        {
            // Arrange
            var simpleSearch = new SimpleSearch();

            simpleSearch.UpdateIndex("findwise", 1);

            // Act
            List <DocumentRatio> result = simpleSearch.Search("findwise");

            // Assert
            Assert.AreEqual(1, result.Count);

            Assert.AreEqual(1, result[0].Id);
            Assert.AreEqual(1, result[0].Ratio);
        }
Ejemplo n.º 13
0
        public void should_only_return_barrskog_document_when_searching_for_barrskogen()
        {
            //Arrange
            var simpleSearch = new SimpleSearch();

            simpleSearch.UpdateIndex(File.ReadAllText("Barrskog.txt"), 1);
            simpleSearch.UpdateIndex(File.ReadAllText("Lövskog.txt"), 2);
            simpleSearch.UpdateIndex(File.ReadAllText("Fjällskog.txt"), 3);

            // Act
            List <DocumentRatio> result = simpleSearch.Search("Barrskogen");

            // Assert
            Assert.AreEqual(1, result.Count);
            Assert.AreEqual(1, result[0].Id);
        }
Ejemplo n.º 14
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Maze Solver!");
            Console.WriteLine("1) for small maze");
            Console.WriteLine("2) for large maze");

            Maze maze;

            var key = Console.ReadKey();

            if (key.KeyChar == '1')
            {
                maze = new Maze(GetMazeData(mazeDefinition), Tuple.Create(1, 1), Tuple.Create(13, 4));
            }
            else if (key.KeyChar == '2')
            {
                maze = new Maze(GetMazeData(mazeDefinition2), Tuple.Create(1, 1), Tuple.Create(35, 21));
            }
            else
            {
                Console.WriteLine();
                Console.WriteLine("Fine, I didn't want to solve a maze, anyway...");
                return;
            }

            AStarSearch strategy = new AStarSearch();

            strategy.Heuristic = s => s.Heuristic();
            var search = new SimpleSearch(strategy);

            search.Find(maze);

            Console.WriteLine("Initial");
            Console.WriteLine(maze);

            int moves = 0;

            foreach (var s in search.Solution)
            {
                Console.WriteLine($"{s.Action} ({++moves})");
                Console.WriteLine(s.State);
            }

            Console.WriteLine($"Solved in {moves} moves");
        }
Ejemplo n.º 15
0
        public void Test_Hard_AStar()
        {
            IState init = new Square(new[] { 1, 2, 3, 4, 5, 6, 7, 0, 8 });

            AStarSearch strategy = new AStarSearch()
            {
                Heuristic = s => s.Heuristic()
            };

            SimpleSearch a        = new SimpleSearch(strategy);
            var          solution = a.Find(init);

            if (solution)
            {
                PrintSolution(a.Solution);
            }
            Assert.IsTrue(solution);
        }
Ejemplo n.º 16
0
        public void should_return_all_documents_when_search_for_skog()
        {
            //Arrange
            var simpleSearch = new SimpleSearch();

            simpleSearch.UpdateIndex(File.ReadAllText("Barrskog.txt"), 1);
            simpleSearch.UpdateIndex(File.ReadAllText("Lövskog.txt"), 2);
            simpleSearch.UpdateIndex(File.ReadAllText("Fjällskog.txt"), 3);

            // Act
            List <DocumentRatio> result = simpleSearch.Search("Skog");

            // Assert
            Assert.AreEqual(3, result.Count);
            Assert.AreEqual(3, result[0].Id);
            Assert.AreEqual(2, result[1].Id);
            Assert.AreEqual(1, result[2].Id);
        }
Ejemplo n.º 17
0
        public static SimpleSearchCollection GetSearchResults(string SearchType, string SubType, string SearchFor, string SearchItem, string ConnectionString)
        {
            StoredProcedure sp = new StoredProcedure("SLLookupSearch");
            sp.Command.AddParameter("@SearchType", SearchType);
            sp.Command.AddParameter("@SubType", SubType);
            sp.Command.AddParameter("@SearchFor", SearchFor);
            sp.Command.AddParameter("@SearchItem", SearchItem);

            IDataReader results = sp.GetReader();

            SimpleSearchCollection sCol = new SimpleSearchCollection();
            while (results.Read())
            {
                SimpleSearch ss = new SimpleSearch();
                ss.ID = (string)results["ID"];
                ss.Name = (string)results["Name"];
                sCol.Add(ss);
            }

            return sCol;
        }
Ejemplo n.º 18
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Maze Solver!");
            Console.WriteLine("1) for small maze");
            Console.WriteLine("2) for large maze");

            Maze maze;

            var key = Console.ReadKey();
            if (key.KeyChar == '1') {
                maze = new Maze(GetMazeData(mazeDefinition), Tuple.Create(1, 1), Tuple.Create(13, 4));
            }
            else if (key.KeyChar == '2') {
                maze = new Maze(GetMazeData(mazeDefinition2), Tuple.Create(1, 1), Tuple.Create(35, 21));
            }
            else
            {
                Console.WriteLine();
                Console.WriteLine("Fine, I didn't want to solve a maze, anyway...");
                return;
            }

            AStarSearch strategy = new AStarSearch();
            strategy.Heuristic = s => s.Heuristic();
            var search = new SimpleSearch(strategy);
            search.Find(maze);

            Console.WriteLine("Initial");
            Console.WriteLine(maze);

            int moves = 0;
            foreach(var s in search.Solution)
            {
                Console.WriteLine($"{s.Action} ({++moves})");
                Console.WriteLine(s.State);
            }

            Console.WriteLine($"Solved in {moves} moves");
        }
Ejemplo n.º 19
0
        private void btnGo_Click(object sender, EventArgs e)
        {
            zedGraphControl1.GraphPane.GraphObjList.RemoveAll(t => t is LineObj);

            SimpleSearchSettings settings = new SimpleSearchSettings();

            settings.fallSearchPeriodInDays = int.Parse(tbFallSearchPeriod.Text);
            settings.riseSearchPeriodInDays = int.Parse(tbRiseSearchPeriod.Text);
            settings.requiredChangeRate     = decimal.Parse(tbRateChange.Text);
            settings.numerOfRepeats         = int.Parse(tbRepeats.Text);

            string symbol = cbSelectSymbol.SelectedItem as string;
            IEnumerable <Price>      data      = this.GetShareData(symbol);
            IEnumerable <SplitEvent> splitData = this.GetSplitData(symbol);

            data = HistoricalPriceReader.Convert(data, splitData).ToArray();

            SimpleSearch processor = new SimpleSearch();

            processor.Process(data.ToArray(), settings);

            DisplaySimpleSearchResults(processor.Results);
        }
Ejemplo n.º 20
0
        public static void Main(string[] args)
        {
            var         initial  = new Square(new[] { 3, 4, 2, 1, 5, 7, 6, 0, 8 });
            AStarSearch strategy = new AStarSearch();

            strategy.Heuristic = s => s.Heuristic();
            var search = new SimpleSearch(strategy);

            search.Find(initial);

            Console.WriteLine("Initial");
            Console.WriteLine(initial);

            int moves = 0;

            foreach (var s in search.Solution)
            {
                Console.WriteLine($"{s.Action} ({++moves})");
                Console.WriteLine(s.State);
            }

            Console.WriteLine($"Solved in {moves} moves");
        }
Ejemplo n.º 21
0
        public void should_return_three_hits_when_search_for_findwise()
        {
            // Arrange
            var simpleSearch = new SimpleSearch();

            simpleSearch.UpdateIndex("findwise", 1);
            simpleSearch.UpdateIndex("hej findwise", 2);
            simpleSearch.UpdateIndex("findwise är kul", 3);

            // Act
            List <DocumentRatio> result = simpleSearch.Search("findwise");

            // Assert
            Assert.AreEqual(3, result.Count);

            Assert.AreEqual(1, result[0].Id);
            Assert.AreEqual(1, result[0].Ratio);

            Assert.AreEqual(2, result[1].Id);
            Assert.AreEqual(0.5M, result[1].Ratio);

            Assert.AreEqual(3, result[2].Id);
            Assert.AreEqual((1M / 3M), result[2].Ratio);
        }
Ejemplo n.º 22
0
 static Searcher()
 {
     SimpleSearch = SimpleSearch<StandardAnalyzer, Schema>.Init(PathToIndex);
 }
Ejemplo n.º 23
0
        static void Main(string[] args)
        {
            using var logStream = new StreamWriter("ef-logs.txt");
            var optionsBuilder = new DbContextOptionsBuilder <Project0databaseContext>();

            optionsBuilder.UseSqlServer(GetConnectionString());
            optionsBuilder.LogTo(logStream.WriteLine, LogLevel.Debug);
            s_dbContextOptions = optionsBuilder.Options;

            StoreRepository repo = new StoreRepository(s_dbContextOptions);
            IDisplay        sd   = new SimpleDisplay();
            ISearch         ss   = new SimpleSearch();

            // new mvc version
            // display all store locations to choose from
            Console.WriteLine("Welcome to XYZ Enterprise, below are a list of our locations:\n ");

            List <CStore> storeBasics = repo.GetAllStores();

            sd.DisplayAllStores(storeBasics);

            Console.WriteLine("Select a store location first:");
            string storeLoc = Console.ReadLine();
            CStore store    = null;

            while (store == null)
            {
                store = repo.GetAStore(storeLoc);
                if (NullChecker(store))
                {
                    storeLoc = Console.ReadLine();
                    continue;
                }
                else
                {
                    break;
                }
            }
            // set up inventory, not the same as add products, more like reset inventory
            InventorySetup(repo, storeLoc, store);
            while (true)
            {
                // read from databse
                // string path = "../../../SimplyWriteData.json";
                // JsonFilePersist persist = new JsonFilePersist(path);
                // CStore store = persist.ReadStoreData();

                Console.WriteLine("\nChoose one of the following operations:\n  1.Add a new customer\n  2.Process an order\n  3.Search a customer\n  4.Display an order\n  5.Display orders of a customer\n  6.Display orders of a store\n  7.Exit the console\n");
                // validation

                bool   hasProfileSetup = false;
                string choice          = Console.ReadLine();
                if (choice == "1")
                {
                    // avoid repetition if already has all customer profiles
                    if (!hasProfileSetup)
                    {
                        CustomerSetup(repo, storeLoc, store);
                        hasProfileSetup = true;
                    }
                    // add a new customer profile if not exist, or nothing
                    CheckAndAddOneCustomer(repo, storeLoc, store, ss);
                }
                else if (choice == "2")
                {
                    // same process as choiece 2 in the beginning
                    if (!hasProfileSetup)
                    {
                        CustomerSetup(repo, storeLoc, store);
                        hasProfileSetup = true;
                    }
                    string customerid = CheckAndAddOneCustomer(repo, storeLoc, store, ss);

                    // process begins
                    List <CProduct> products     = ProductsSetup(repo);
                    string          orderid      = OIDGen.Gen();
                    string          extraStuff   = "this is outdated";
                    string          myStuff      = "my change must be reainted";
                    double          totalCost    = store.CalculateTotalPrice(products);
                    bool            isSuccessful = false;
                    COrder          newOrder     = new COrder(orderid, store, store.CustomerDict[customerid],
                                                              DateTime.Now, totalCost);
                    try
                    {
                        // quantity limits
                        newOrder.ProductList = products;
                        isSuccessful         = true;
                        Console.WriteLine("Order created successfully!");
                    }
                    catch (ArgumentException e)
                    {
                        isSuccessful = false;
                        Console.WriteLine("This order exceeds the max allowed quantities, failed to create the order!");
                    }

                    if (isSuccessful)
                    {
                        if (!store.CheckInventory(newOrder))
                        {
                            Console.WriteLine("Do not have enough products left to fulfill this order!");
                        }
                        else
                        {
                            // map products to an order, orders to a customer,
                            // store now has complete information
                            foreach (var pair in store.CustomerDict)
                            {
                                CCustomer customer = pair.Value;
                                customer.OrderHistory = repo.GetAllOrdersOfOneCustomer(customer.Customerid, store, customer);
                                foreach (var order in customer.OrderHistory)
                                {
                                    order.ProductList = repo.GetAllProductsOfOneOrder(order.Orderid);
                                    order.TotalCost   = store.CalculateTotalPrice(order.ProductList);
                                }
                            }
                            store.UpdateInventoryAndCustomerOrder(newOrder);
                            repo.CustomerPlaceOneOrder(newOrder, store, totalCost);
                        }
                    }
                }

                else if (choice == "3")
                {
                    while (true)
                    {
                        Console.WriteLine("Enter Customer's first name");
                        string firstname = ValidateNotNull(Console.ReadLine());
                        Console.WriteLine("Enter Customer's last name");
                        string lastname = ValidateNotNull(Console.ReadLine());
                        Console.WriteLine("Enter Customer's phone number");
                        string phonenumber = ValidatePhonenumber(Console.ReadLine());

                        CCustomer foundCustomer = repo.GetOneCustomerByNameAndPhone(firstname, lastname, phonenumber);
                        if (NullChecker(foundCustomer))
                        {
                            continue;
                        }
                        else
                        {
                            Console.WriteLine($"{foundCustomer.Customerid} found, customer alreay exist in the database");
                            break;
                        }
                    }
                }
                else if (choice == "4")
                {
                    while (true)
                    {
                        Console.WriteLine("What is the orderid?");
                        string orderid    = ValidateNotNull(Console.ReadLine());
                        COrder foundOrder = repo.GetAnOrderByID(orderid);
                        if (NullChecker(foundOrder))
                        {
                            continue;
                        }
                        else
                        {
                            sd.DisplayOneOrder(foundOrder);
                            break;
                        }
                        // need an option to search by store location, customerid, and orderdata
                    }
                }
                else if (choice == "5")
                {
                    while (true)
                    {
                        // same as search for a customer in the beginning
                        Console.WriteLine("Enter Customer's first name");
                        string firstname = ValidateNotNull(Console.ReadLine());
                        Console.WriteLine("Enter Customer's last name");
                        string lastname = ValidateNotNull(Console.ReadLine());
                        Console.WriteLine("Enter Customer's phone number");
                        string    phonenumber   = ValidatePhonenumber(Console.ReadLine());
                        CCustomer foundCustomer = repo.GetOneCustomerOrderHistory(firstname, lastname, phonenumber, store);

                        if (NullChecker(foundCustomer))
                        {
                            continue;
                        }
                        else
                        {
                            sd.DisplayAllOrders(foundCustomer.OrderHistory);
                            break;
                        }
                    }
                }
                else if (choice == "6")
                {
                    while (true)
                    {
                        Console.WriteLine("What is the store location you seek?");
                        string seekLoc   = ValidateNotNull(Console.ReadLine());
                        CStore seekStore = repo.GetOneStoreOrderHistory(seekLoc);
                        if (NullChecker(seekStore))
                        {
                            continue;
                        }
                        foreach (var pair in seekStore.CustomerDict)
                        {
                            sd.DisplayAllOrders(pair.Value.OrderHistory);
                        }
                        break;

                        /*
                         * CStore seekStore = repo.GetAStore(seekLoc);
                         * if (NullChecker(seekStore)) continue;
                         *
                         * seekStore.CustomerDict = repo.GetAllCustomersAtOneStore(seekLoc);
                         *
                         * foreach (var pair in seekStore.CustomerDict)
                         * {
                         *  CCustomer cust = pair.Value;
                         *  cust.OrderHistory = repo.GetAllOrdersOfOneCustomer(cust.Customerid, seekStore, cust);
                         *  foreach (var order in cust.OrderHistory)
                         *  {
                         *      order.ProductList = repo.GetAllProductsOfOneOrder(order.Orderid);
                         *      order.TotalCost = store.CalculateTotalPrice(order.ProductList);
                         *  }
                         *  sd.DisplayAllOrders(cust.OrderHistory);
                         * }
                         * break;
                         */
                    }
                }
                else if (choice == "7")
                {
                    Console.WriteLine("Thank you for using XYZ Enterprise!");
                    break;
                }
                // invalid commands
                else
                {
                    Console.WriteLine("Choose one of the options above, other inputs are invalid!");
                }
            }
        }
Ejemplo n.º 24
0
        public static void Main(string[] args)
        {
            if (5 != args.Length || "'".Equals(args[4]) || !args[4].StartsWith("'") || !args[4].EndsWith("'"))
            {
                Console.WriteLine($"Usage: {System.Reflection.Assembly.GetEntryAssembly().ManifestModule.Name} <apidomain> <httpBasicAuthString> <servicetype> <realm> '<simplesearchexpression>'");
            }
            else
            {
                string apiDomain           = args[0];
                string httpBasicAuthString = args[1];
                string serviceType         = args[2];
                string realm = args[3];
                string rawSearchExpression = args[4].Trim('\'');

                Uri upstreamServerUrl = new Uri($"https://{apiDomain}");

                using (CtmsRegistryClient registryClient = new CtmsRegistryClient(new OAuth2AuthorizationConnection(upstreamServerUrl, httpBasicAuthString)))
                {
                    const string registeredLinkRelSearches = "search:searches";
                    Searches     searchesResource          = PlatformTools.PlatformToolsSDK.FindInRegistry <Searches>(registryClient, serviceType, realm, registeredLinkRelSearches);

                    if (null != searchesResource)
                    {
                        const string registeredLinkRelSimpleSearch = "search:simple-search";
                        Link         simpleSearchLink = searchesResource.DiscoverLink(registeredLinkRelSimpleSearch);
                        /// Check, whether simple search is supported:
                        if (null != simpleSearchLink)
                        {
                            UriTemplate simpleSearchUrlTemplate = new UriTemplate(simpleSearchLink.Href);
                            simpleSearchUrlTemplate.SetParameter("search", rawSearchExpression);
                            Uri simpleSearchResultPageUrl = new Uri(simpleSearchUrlTemplate.Resolve());

                            /// Doing the search and write the results to stdout:
                            SimpleSearch searchResult = registryClient.GetHalResource <SimpleSearch>(simpleSearchResultPageUrl);

                            int assetNo = 0;
                            int pageNo  = 0;
                            // Page through the result:
                            StringBuilder sb = new StringBuilder();
                            do
                            {
                                if (searchResult.AssetList.Any())
                                {
                                    sb.AppendLine($"Page#: {++pageNo}, search expression: '{rawSearchExpression}'");
                                    foreach (Asset asset in searchResult.AssetList)
                                    {
                                        BaseInfo         baseInfo         = asset.Base;
                                        CommonAttributes commonAttributes = asset.Common;

                                        sb.AppendLine($"Asset#: {++assetNo}, id: {asset.Base.Id}, name: '{asset.Common.Name}'");
                                    }
                                }

                                // If we have more results, follow the next link and get the next page:
                                searchResult = registryClient.GetHalResource <SimpleSearch>(searchResult.GetUri("next", Enumerable.Empty <EmbedResource>()));
                            }while (searchResult != null);
                            Console.WriteLine(sb);
                        }
                    }
                }

                Console.WriteLine("End");
            }
        }