public void IndexingBySecond_ReturnsCorrectFirst() { //indexing <string,string> is ambiguous, need a custom map //arrange OneToOneConversionMap <string, int> alphaIndices = new OneToOneConversionMap <string, int>(); alphaIndices.Add("a", 1); alphaIndices.Add("b", 2); //act/assert Assert.AreEqual("a", alphaIndices[1]); }
public void PerTestSetup() { //because we have knowledge of implementation, we can assume that add will maintain a valid state //since not much is going on. Likewise, there's not too much going on in the Get methods //For milestone 1, I really only want to test the "Try____" methods because they have meaningful choices being made //with a few inputs and outputs instance = new OneToOneConversionMap <string, string>(); //add some data. doesn't matter too much as long as we know what's in the map instance.Add("a", "b"); instance.Add("", "c"); instance.Add("d", "text"); }
public void Add_WithDuplicateFirst_ThrowsArgumentException() { Assert.Throws <ArgumentException>(() => instance.Add("a", "Don't care")); }