Exemplo n.º 1
0
        public void TestRemoveSynchronization()
        {
            List<string> files = new List<string>() { "file1.txt", "file2.txt", "file3.txt" };
            var storage1 = new SimpleStorage("Storage 1", files);
            var storage2 = new SimpleStorage("Storage 2", files);
            var synchronizer = new Synchronizer(storage1, storage2);

            storage2.Remove("file2.txt");

            Assert.IsTrue(storage1.Equals(storage2));
        }
Exemplo n.º 2
0
        public void TestAddSynchronization()
        {
            var storage1 = new SimpleStorage("Storage 1");
            var storage2 = new SimpleStorage("Storage 2");
            var synchronizer = new Synchronizer(storage1, storage2);

            storage1.Add("file1.txt");
            storage2.Add("file2.txt");

            Assert.IsTrue(storage1.Equals(storage2));
        }
Exemplo n.º 3
0
        public void TestMultiAndSingleThreadAddSynchronization()
        {
            var storage1 = new SimpleStorage("Storage1");
            var storage2 = new MultiThreadStorage("Storage 2");
            var synhronizer = new Synchronizer(storage1, storage2);

            storage1.Add("file1.txt");
            storage2.Add("file2.txt");
            Thread.Sleep(10000);

            Assert.IsTrue(storage1.Equals(storage2));
        }