public void GetAutoCompleteNames_HasGatherer_ReturnsNames() { var gatherer = new Mock<IAutoCompleteValueProvider>(); gatherer.Setup(g => g.GetValuesForKey("person")).Returns(new[] { "jimmy", "tommy" }); _model = new ContributorsListControlViewModel(gatherer.Object, null); var names = _model.GetAutoCompleteNames(); Assert.AreEqual(2, names.Count); Assert.IsTrue(names.Contains("jimmy")); Assert.IsTrue(names.Contains("tommy")); }
public void TestSetup() { var system = new OlacSystem(); _model = new ContributorsListControlViewModel(null, null); _contributions = new ContributionCollection(new[] { new Contribution("Leroy", system.GetRoles().ElementAt(0)), new Contribution("Jed", system.GetRoles().ElementAt(1)), new Contribution("Art", system.GetRoles().ElementAt(2)) }); _model.SetContributionList(_contributions); }