Ejemplo n.º 1
0
        public void SetSharedCounts_Instantiates_Properly(int dirs, int files)
        {
            var a = new SetSharedCountsCommand(dirs, files);

            Assert.Equal(dirs, a.DirectoryCount);
            Assert.Equal(files, a.FileCount);
        }
Ejemplo n.º 2
0
        public void SetSharedCounts_Constructs_The_Correct_Message(int dirs, int files)
        {
            var a   = new SetSharedCountsCommand(dirs, files);
            var msg = a.ToByteArray();

            var reader = new MessageReader <MessageCode.Server>(msg);
            var code   = reader.ReadCode();

            Assert.Equal(MessageCode.Server.SharedFoldersAndFiles, code);
            Assert.Equal(dirs, reader.ReadInteger());
            Assert.Equal(files, reader.ReadInteger());
        }