public void AddManyToNonDictionaryThrows(object specimen) { // Arrange var dummyContext = new DelegatingSpecimenContext(); // Act & assert Assert.Throws <ArgumentException>(() => DictionaryFiller.AddMany(specimen, dummyContext)); }
public void AddManyWithNullContextThrows() { // Arrange var dummyDictionary = new Dictionary <object, object>(); // Act & assert Assert.Throws <ArgumentNullException>(() => DictionaryFiller.AddMany(dummyDictionary, null)); }
public void AddManyToNullSpecimenThrows() { // Arrange var dummyContext = new DelegatingSpecimenContext(); // Act & assert Assert.Throws <ArgumentNullException>(() => DictionaryFiller.AddMany(null, dummyContext)); }
public void AddManyToNonDictionaryThrows(object specimen) { // Fixture setup var dummyContext = new DelegatingSpecimenContext(); // Exercise system and verify outcome Assert.Throws <ArgumentException>(() => DictionaryFiller.AddMany(specimen, dummyContext)); // Teardown }
public void AddManyWithNullContextThrows() { // Fixture setup var dummyDictionary = new Dictionary <object, object>(); // Exercise system and verify outcome Assert.Throws <ArgumentNullException>(() => DictionaryFiller.AddMany(dummyDictionary, null)); // Teardown }
public void AddManyFillsDictionary() { // Fixture setup var dictionary = new Dictionary <int, string>(); var expectedRequest = new MultipleRequest(typeof(KeyValuePair <int, string>)); var expectedResult = Enumerable.Range(1, 3).Select(i => new KeyValuePair <int, string>(i, i.ToString())); var context = new DelegatingSpecimenContext { OnResolve = r => expectedRequest.Equals(r) ? (object)expectedResult : new NoSpecimen(r) }; // Exercise system DictionaryFiller.AddMany(dictionary, context); // Verify outcome Assert.True(expectedResult.SequenceEqual(dictionary)); // Teardown }
public void AddManyFillsDictionary() { // Arrange var dictionary = new Dictionary <int, string>(); var expectedRequest = new MultipleRequest(typeof(KeyValuePair <int, string>)); var expectedResult = Enumerable.Range(1, 3).Select(i => new KeyValuePair <int, string>(i, i.ToString())); var context = new DelegatingSpecimenContext { OnResolve = r => expectedRequest.Equals(r) ? (object)expectedResult : new NoSpecimen() }; // Act DictionaryFiller.AddMany(dictionary, context); // Assert Assert.True(expectedResult.SequenceEqual(dictionary)); }