nassss

Untitled

Mar 26th, 2020
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using DictionaryWorkshop.Implementation;
  5. using DictionaryWorkshop.Implementation.Contracts;
  6. using DictionaryWorkshop.Models;
  7.  
  8. using Microsoft.VisualStudio.TestTools.UnitTesting;
  9.  
  10. namespace DictionaryWorkshop.Tests
  11. {
  12. [TestMethod]
  13. public void Remove_ExistingElement_ShouldWorkCorrectly()
  14. {
  15. // Arrange
  16. MyDictionary<string, double> dictionary = new MyDictionary<string, double>
  17.  
  18. { { "Vasko", 12.5 }, { "Maria", 99.9 } };
  19.  
  20. // Assert
  21. Assert.AreEqual(2, dictionary);
  22.  
  23. // Act
  24. bool removed = dictionary.Remove("Vasko");
  25.  
  26. // Assert
  27. Assert.IsTrue(removed);
  28. Assert.AreEqual(1, dictionary.Count);
  29. }
  30. }
Add Comment
Please, Sign In to add comment