Exemple #1
0
        public void EqualsTest()
        {
            ParserResult sut, sut2;
            IDictionary <string, string> data, data2;
            bool expect;


            expect = false;
            data   = new Dictionary <string, string>();
            data2  = new Dictionary <string, string>();
            sut    = new ParserResult(data);
            sut2   = null;
            Assert.Equal(expect, sut.Equals(sut2));

            expect = true;
            data   = new Dictionary <string, string>();
            data2  = new Dictionary <string, string>();
            sut    = new ParserResult(data);
            sut2   = new ParserResult(data2);
            Assert.Equal(expect, sut.Equals(sut2));

            expect = false;
            data   = new Dictionary <string, string>()
            {
                { "", "" }
            };
            data2 = new Dictionary <string, string>();
            sut   = new ParserResult(data);
            sut2  = new ParserResult(data2);
            Assert.Equal(expect, sut.Equals(sut2));

            expect = true;
            data   = new Dictionary <string, string>()
            {
                { "", "" }
            };
            data2 = new Dictionary <string, string>()
            {
                { "", "" }
            };
            sut  = new ParserResult(data);
            sut2 = new ParserResult(data2);
            Assert.Equal(expect, sut.Equals(sut2));

            expect = false;
            data   = new Dictionary <string, string>()
            {
                { "1", "A" }
            };
            data2 = new Dictionary <string, string>()
            {
                { "1", "B" }
            };
            sut  = new ParserResult(data);
            sut2 = new ParserResult(data2);
            Assert.Equal(expect, sut.Equals(sut2));

            expect = true;
            data   = new Dictionary <string, string>()
            {
                { "1", "A" }, { "2", "B" }
            };
            data2 = new Dictionary <string, string>()
            {
                { "2", "B" }, { "1", "A" }
            };
            sut  = new ParserResult(data);
            sut2 = new ParserResult(data2);
            Assert.Equal(expect, sut.Equals(sut2));
        }