Exemplo n.º 1
0
        public void ThenCompaniesShouldBeFound(string companies, string name)
        {
            var companiesList  = companies.Split(new[] { ", " }, StringSplitOptions.RemoveEmptyEntries);
            var foundCompanies = context.GetMatcher().All <Company>(name).Select(x => x.Value.Name).ToList();

            CollectionAssert.AreEquivalent(companiesList, foundCompanies);
        }
Exemplo n.º 2
0
        public static IMatcher SetTestMatcher(this ITestingContext context)
        {
            var matcher = context.GetMatcher();

            context.Storage.Set(matcher, "matcher");
            return(matcher);
        }
Exemplo n.º 3
0
        public void ThenNothingShouldBeFoundAndTheSearchTimeIsUnderSec(int seconds)
        {
            var watch = Stopwatch.StartNew();
            var match = context.GetMatcher().All <Model>("model").FirstOrDefault();

            watch.Stop();
            Debug.WriteLine("search in " + watch.Elapsed);
            Assert.IsNull(match);
            Assert.IsTrue(watch.ElapsedMilliseconds < 1000 * seconds);
        }
Exemplo n.º 4
0
 public void WhenInsuranceResolves(string key)
 {
     try
     {
         var value = context.GetMatcher().All <Insurance>(key);
     }
     catch (RegistrationException ex)
     {
         context.Storage.Set(ex);
     }
 }