Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }