public void ShouldFailRegistrationRuleBadData() { _fixture = new RegistrationRule(DateTime.MinValue, DateTime.MaxValue, 100); var data = new Dictionary <string, object> { { "registrantCount", "threeve" } }; var ex = Assert.Throws <InvalidDataException>(() => _fixture.RulePasses(data)); Assert.AreEqual("Invalid data provided to registration rule.", ex.Message); }
public void ShouldPassInactiveRegistrationRulePastEndDate() { _fixture = new RegistrationRule(DateTime.MinValue, DateTime.Today.AddDays(-1), 100); var data = new Dictionary <string, object> { { "registrantCount", 1 } }; var result = _fixture.RulePasses(data); Assert.IsTrue(result.RulePassed); Assert.AreEqual("Rule Not Active", result.Message); }
public void ShouldFailRegistrationRule() { _fixture = new RegistrationRule(DateTime.MinValue, DateTime.MaxValue, 100); var data = new Dictionary <string, object> { { "registrantCount", 101 } }; var result = _fixture.RulePasses(data); Assert.IsFalse(result.RulePassed); Assert.AreEqual("Exceeded Maximum of 100", result.Message); }
public void ShouldPassRegistrationRuleNoEndDate() { _fixture = new RegistrationRule(DateTime.MinValue, null, 100); var data = new Dictionary <string, object> { { "registrantCount", 1 } }; var result = _fixture.RulePasses(data); Assert.IsTrue(result.RulePassed); Assert.AreEqual("Rule Passed", result.Message); }