Пример #1
0
        public override void SetUp()
        {
            base.SetUp();
            DTOUser           user;
            List <DTONote>    sample_notes;
            JsonServiceClient client = GetAdminServiceClient();

            user = new DTOUser()
            {
                Username       = "******",
                Password       = "******",
                AdditionalData = "Its just john"
            };
            var user_url = new Rainy.WebService.Management.UserRequest().ToUrl("POST");

            client.Post <DTOUser> (user_url, user);
            sampleUser.Add(user);

            // add sample notes
            sample_notes = AbstractSyncServerTests.GetSomeSampleNotes()
                           .Select(n => n.ToDTONote()).ToList();

            var syncServer = new WebSyncServer(testServer.RainyListenUrl, testServer.GetAccessToken());

            var storage = new DiskStorage();
            var tmpPath = "/tmp/sync1";

            storage.SetPath(tmpPath);
            var engine     = new Engine(storage);
            var syncClient = new FilesystemSyncClient(engine, new SyncManifest());

            var syncManager = new Tomboy.Sync.SyncManager(syncClient, syncServer);

            syncManager.DoSync();

            sampleNotes[user.Username] = sample_notes;


            user = new DTOUser()
            {
                Username       = "******",
                Password       = "******",
                AdditionalData = "Jane, Johns wife"
            };
            client.Post <DTOUser> (user_url, user);
            sampleUser.Add(user);
            sampleNotes[user.Username] = AbstractSyncServerTests.GetSomeSampleNotes()
                                         .Select(n => n.ToDTONote()).ToList();

            // add sample user data
        }
Пример #2
0
        public override void SetUp()
        {
            base.SetUp ();
            DTOUser user;
            List<DTONote> sample_notes;
            JsonServiceClient client = GetAdminServiceClient ();

            user = new DTOUser() {
                Username = "******",
                Password = "******",
                AdditionalData = "Its just john"
            };
            var user_url = new Rainy.WebService.Management.UserRequest ().ToUrl("POST");
            client.Post<DTOUser> (user_url, user);
            sampleUser.Add (user);

            // add sample notes
            sample_notes = AbstractSyncServerTests.GetSomeSampleNotes ()
                .Select (n => n.ToDTONote ()).ToList ();

            var syncServer = new WebSyncServer (testServer.RainyListenUrl, testServer.GetAccessToken ());

            var storage = new DiskStorage ();
            var tmpPath = "/tmp/sync1";
            storage.SetPath (tmpPath);
            var engine = new Engine (storage);
            var syncClient = new FilesystemSyncClient (engine, new SyncManifest ());

            var syncManager = new Tomboy.Sync.SyncManager (syncClient, syncServer);
            syncManager.DoSync ();

            sampleNotes[user.Username] = sample_notes;

            user = new DTOUser() {
                Username = "******",
                Password = "******",
                AdditionalData = "Jane, Johns wife"
            };
            client.Post<DTOUser> (user_url, user);
            sampleUser.Add (user);
            sampleNotes[user.Username] = AbstractSyncServerTests.GetSomeSampleNotes ()
                .Select (n => n.ToDTONote ()).ToList ();

            // add sample user data
        }