Exemplo n.º 1
0
        public void If_remove_single_key_Then_item_is_removed()
        {
            var result = _sut.Remove("Key1");

            Assert.That(result, Is.True);
            Assert.That(_sut.ContainsKey("key1"), Is.False);
        }
Exemplo n.º 2
0
        public void If_adding_single_item_Then_expected_count_and_values_match()
        {
            _sut.Add(1, 1000);

            Assert.That(_sut.Count, Is.EqualTo(1));
            Assert.That(_sut.ContainsKey(1), Is.True);
            Assert.That(_sut.GetValues(1), Is.EquivalentTo(new[] { 1000 }));
            Assert.That(_sut.GetValuesAsHashSet(1), Is.EquivalentTo(new[] { 1000 }));
            Assert.That(_sut.Keys, Is.EquivalentTo(new[] { 1 }));
            Assert.That(_sut.Values, Is.EquivalentTo(new[] { 1000 }));
        }
Exemplo n.º 3
0
        public void If_addMany_with_key_and_no_values_Then_count_and_values_match()
        {
            _sut.AddMany(1, new int[0]);

            Assert.That(_sut.Count, Is.EqualTo(0));
            Assert.That(_sut.ContainsKey(0), Is.False);
            Assert.That(_sut.GetValues(1), Is.Empty);
            Assert.That(_sut.GetValuesAsHashSet(1), Is.Empty);
            Assert.That(_sut.Keys, Is.Empty);
            Assert.That(_sut.Values, Is.Empty);
        }
        public void Then_count_and_values_match()
        {
            Assert.That(_sut.IsReadOnly, Is.False);

            Assert.That(_sut.Count, Is.EqualTo(0));
            Assert.That(_sut.ContainsKey(1), Is.False);

            Assert.That(_sut.GetValues(1), Is.Empty);
            Assert.That(_sut.GetValuesAsHashSet(1), Is.Empty);

            Assert.That(_sut.Keys, Is.Empty);
            Assert.That(_sut.Keys.IsReadOnly, Is.True);

            Assert.That(_sut.Values, Is.Empty);
            Assert.That(_sut.Values.IsReadOnly, Is.True);
        }