public void VerifySpecShouldNotAllowAList() { //Arrange bool exceptionThrown = false; ComparisonConfig config = new ComparisonConfig(); config.CollectionMatchingSpec = new Dictionary <Type, IEnumerable <string> >(); config.CollectionMatchingSpec.Add(typeof(List <Offer>), new List <string> { "Id" }); VerifyConfig verifyConfig = new VerifyConfig(); //Act try { verifyConfig.VerifySpec(config); } catch (Exception ex) { exceptionThrown = true; Assert.IsTrue(ex.Message.Contains("should be a class, not a List")); } Assert.IsTrue(exceptionThrown, "Expected Exception to be thrown"); }
public void VertifyFail(string code, string validCode, int lastestAttempt, VerifyConfig verifyConfig, VertifyResponse expected) { this.otp.Setup(x => x.GetOTP()).Returns(validCode); this.counter.Setup(x => x.GetVertify()).Returns(lastestAttempt); this.dac.Setup(x => x.GetVerifyConfig()).Returns(verifyConfig); BackOffController backOffCtr = new BackOffController(counter.Object, dac.Object, time.Object, otp.Object); var result = backOffCtr.Vertify(code); result.Should().BeEquivalentTo(expected); }