Пример #1
0
        public void FileList_HasMatches_CountIsCorrect()
        {
            var mockSocket = Substitute.For <ISymSocket>();

            mockSocket.ReadCommand()
            .Returns(
                new SymCommand("FileList", new Dictionary <string, string>
            {
                { "Name", "RandomFile" },
                { "Date", "01012013" },
                { "Time", "1153" },
                { "Size", "1123" },
            }),
                new SymCommand("FileList", new Dictionary <string, string>
            {
                { "Name", "RandomFile2" },
                { "Date", "01012013" },
                { "Time", "1153" },
                { "Size", "1123" },
            }),
                new SymCommand("FileList", new Dictionary <string, string> {
                { "Done", "" }
            })
                );

            var session = new SymSession(mockSocket, 10);

            session.FileList("RandomFile+", FileType.RepGen).Count.Should().Be(2);
        }
Пример #2
0
        public void FileList_NoMatches_CountIsZero()
        {
            var mockSocket = Substitute.For <ISymSocket>();

            mockSocket.ReadCommand().Returns(new SymCommand("FileList", new Dictionary <string, string> {
                { "Done", "" }
            }));

            var session = new SymSession(mockSocket, 10);

            session.FileList("--", FileType.RepGen).Count.Should().Be(0);
        }
Пример #3
0
        public void FileList_NoMatches_CountIsZero()
        {
            var mockSocket = Substitute.For<ISymSocket>();
            mockSocket.ReadCommand().Returns(new SymCommand("FileList", new Dictionary<string, string> {{"Done", ""}}));

            var session = new SymSession(mockSocket, 10);

            session.FileList("--", FileType.RepGen).Count.Should().Be(0);
        }
Пример #4
0
        public void FileList_HasMatches_CountIsCorrect()
        {
            var mockSocket = Substitute.For<ISymSocket>();
            mockSocket.ReadCommand()
                .Returns(
                    new SymCommand("FileList", new Dictionary<string, string>
                                                 {
                                                     {"Name", "RandomFile"},
                                                     {"Date", "01012013"},
                                                     {"Time", "1153"},
                                                     {"Size", "1123"},
                                                 }),
                    new SymCommand("FileList", new Dictionary<string, string>
                                                 {
                                                     {"Name", "RandomFile2"},
                                                     {"Date", "01012013"},
                                                     {"Time", "1153"},
                                                     {"Size", "1123"},
                                                 }),
                    new SymCommand("FileList", new Dictionary<string, string> { { "Done", "" } })
                );

            var session = new SymSession(mockSocket, 10);

            session.FileList("RandomFile+", FileType.RepGen).Count.Should().Be(2);
        }