public void CanGetPerRequestTheory(IDictionary dictionary, bool shouldBeEqual) { using (var factory = new DummyFactory()) { var dummyFirst = factory.GetPerRequest(dictionary); Assert.NotNull(dummyFirst); var dummySecond = factory.GetPerRequest(dictionary); Assert.NotNull(dummySecond); if (shouldBeEqual) { Assert.Equal(dummyFirst, dummySecond); } else { Assert.NotEqual(dummyFirst, dummySecond); } } }
public void CanStoreObjectByKeyTheory(string key) { using (var factory = new DummyFactory(key)) { var dictionary = new Dictionary <string, object>(); var dummyObject = factory.GetPerRequest(dictionary); Assert.NotNull(dummyObject); Assert.True(dictionary.ContainsKey(key)); Assert.Equal(dummyObject, dictionary[key]); } }