public void Content_JsonFilesHaveValidJsonSyntax() { // Arrange // Act try { _questionLoader.GetQuestions(); _obligationLoader.GetObligations(); _rulesetLoader.GetRulesets(); _personaLoader.GetPersonas(); } catch (Exception ex) { Assert.Fail(ex.Message); } }
public void LoadPersonas() { // Act var questions = _loader.GetPersonas(); // Assert Assert.IsNotNull(questions); Assert.AreEqual(1, questions.Count); Assert.IsNotNull(questions.First().IncludedAnswerList); Assert.AreEqual(2, questions.First().IncludedAnswerList.Length); }
public void AddsToCache() { // Arrange _loader = new FilePersonaLoader(_fakeCacheManger.Object, _fakeFilePathResolver.Object, DirectoryName, CacheName); _fakeCacheManger.Setup(x => x.Contains(CacheName)).Returns(false); // Act _loader.GetPersonas(); //Assert _fakeCacheManger.Verify(x => x.Get(CacheName), Times.Once); _fakeCacheManger.Verify(x => x.Add(CacheName, It.IsAny <List <IPersona> >()), Times.Once); }
public IPersona GetPersona(IDictionary <string, IAnswer[]> visitorAnswers) { return(_personaLoader.GetPersonas().FirstOrDefault(persona => DoesPersonaMatch(persona, visitorAnswers))); }