public void CreateAddClear() { var sRepo = new SourceRepository(); Assert.True(sRepo.Count == 0); var source = new CodeCoverageStringTextSource("", ""); const uint fileId = 1; sRepo.Add(fileId, source); Assert.True(sRepo.Count == 1); sRepo.Clear(); Assert.True(sRepo.Count == 0); }
public void CreateAddRemoveKeyValuePair() { var sRepo = new SourceRepository(); Assert.True(sRepo.Count == 0); var source = new CodeCoverageStringTextSource("", ""); const uint fileId = 1; sRepo.Add(new KeyValuePair <uint, CodeCoverageStringTextSource>(fileId, source)); Assert.True(sRepo.Contains(new KeyValuePair <uint, CodeCoverageStringTextSource>(fileId, source))); Assert.True(sRepo.Remove(new KeyValuePair <uint, CodeCoverageStringTextSource>(fileId, source))); Assert.False(sRepo.Remove(new KeyValuePair <uint, CodeCoverageStringTextSource>(fileId, source))); sRepo.Clear(); Assert.True(sRepo.Count == 0); }