コード例 #1
0
    public void ContainsKey_NonExistingElement_ShouldReturnFalse()
    {
        // Arrange
        var dictionary = new DictionaryDataStructure.Dictionary<DateTime, string>();
        var date = new DateTime(1995, 7, 18);

        // Act
        var containsKey = dictionary.ContainsKey(date);

        // Assert
        Assert.IsFalse(containsKey);
    }
コード例 #2
0
    public void ContainsKey_ExistingElement_ShouldReturnTrue()
    {
        // Arrange
        var dictionary = new DictionaryDataStructure.Dictionary<DateTime, string>();
        var date = new DateTime(1995, 7, 18);
        dictionary.Add(date, "Some value");

        // Act
        var containsKey = dictionary.ContainsKey(date);

        // Assert
        Assert.IsTrue(containsKey);
    }