public void ComparisonService_ExpectedNResults_TestMethod()
        {
            var clients = _clientInfoRepository.GetAll();
            int nDiff   = _comparisonService.CompareNDifferentProperties(clients[0], clients[1]);

            Trace.WriteLine(string.Format("difrence between to objects is {0}", nDiff));
            Assert.IsTrue(nDiff == 2);
        }
Example #2
0
        public void SearchService_ExpectedValue_TestMethod()
        {
            string searchTerm       = "PER";
            var    clients          = _clientInfoRepository.GetAll();
            string splittingSentece = _searchService.Search(clients[0].Email, searchTerm);

            Trace.WriteLine(splittingSentece);
            string splitingChar = _configService.Get("SerachSentenceSplitter");

            string[] sentence = splittingSentece.Split(splitingChar.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
            Trace.WriteLine(string.Format("foundTerm is: {0}, searchTerm is: {1}", sentence[1], searchTerm));
            Assert.IsTrue(!string.IsNullOrWhiteSpace(splittingSentece));
            Assert.IsTrue(sentence.Length == 5);
            Assert.IsTrue(sentence[1] == sentence[3]);
            Assert.IsTrue(sentence[1].ToUpper() == searchTerm);
            Assert.IsFalse(sentence[1] == searchTerm);
        }
Example #3
0
        public IEnumerable <ClientInfo> GetClientInfos()
        {
            var clientInfos = _iClientInfoRepository.GetAll();

            return(clientInfos);
        }
Example #4
0
 /// <summary>
 /// Gets all registered clients' ips.
 /// </summary>
 /// <returns>Collection of ips.</returns>
 public IEnumerable <ClientInfo> GetAllRegisteredClients()
 {
     return(_repository.GetAll());
 }