コード例 #1
0
ファイル: GenericToolsTests.cs プロジェクト: int32at/utils
        public void GenericTools_Collections_FluentDictionary()
        {
            var dict = new FluentDictionary <string, int>()
                       .Add("Key1", 1)
                       .Add("Key2", 2)
                       .Add("Key3", 3)
                       .Remove("Key3");

            MakeSure.That(dict.Count).Is(2);
            MakeSure.That(dict.ContainsKey("Key2")).Is(true);
            MakeSure.That(dict["Key1"]).Is(1);
            MakeSure.That(dict.Keys.Count).Is(2);
            MakeSure.That(dict.Values.Count).Is(2);

            dict.Clear();

            MakeSure.That(dict.Count).Is(0);
        }