public void TestAddNickname() { var config = new Config(); Mock<IConfigService>() .Setup(call => call.GetConfig()) .Returns(config); service.Add("bob"); var section = config.GetSection("Nicknames"); Assert.AreEqual(1, section.Count); Assert.AreEqual("bob", section[0].Key); }
public void TestRemoveNickname() { var config = new Config(); config.SetValue("Nicknames", "bob", string.Empty); config.SetValue("Nicknames", "alice", string.Empty); Mock<IConfigService>() .Setup(call => call.GetConfig()) .Returns(config); service.Remove("bob"); var section = config.GetSection("Nicknames"); Assert.AreEqual(1, section.Count); Assert.AreEqual("alice", section[0].Key); }