Ejemplo n.º 1
0
 public void Should_set_metric_route_value()
 {
     int valueToset = 0;
     var provider = new EmptyRouteValueProvider();
     var metric = "metricName";
     var expectedValue = 123;
     provider.ProvideRouteValue(metric, s => s == "metricVariantId" ? expectedValue : 000, (s, o) => valueToset = (s == metric) ? (int)o : 999);
     Assert.AreEqual(expectedValue, valueToset);
 }
Ejemplo n.º 2
0
 public void Should_set_student_route_value()
 {
     int valueToset = 0;
     var provider = new EmptyRouteValueProvider();
     var student = "student";
     var expectedValue = 123;
     provider.ProvideRouteValue(student, s => s == "studentUSI" ? expectedValue : 000, (s, o) => valueToset = (s == student) ? (int)o : 999);
     Assert.AreEqual(expectedValue, valueToset);
 }
Ejemplo n.º 3
0
 public void Should_be_able_to_provide_value_for_staff()
 {
     var provider = new EmptyRouteValueProvider();
     var result = provider.CanProvideRouteValue("staff", s => 0);
     Assert.AreEqual(true, result);
 }
Ejemplo n.º 4
0
 public void Should_not_be_able_to_provide_value_for_some_other_route()
 {
     var provider = new EmptyRouteValueProvider();
     var result = provider.CanProvideRouteValue("unrelated", s => 0);
     Assert.AreEqual(false, result);
 }