Exemplo n.º 1
0
        public void StatFile()
        {
            const string data = "test string";

            var handle = new WriteFileHandle(data);
            handle.OpenWrite(TestFilePath);

            Loop.Current.Run();

            var handle2 = new Filesystem();
            handle2.Stat(TestFilePath, (args) => {
                Assert.AreEqual(data.Length, args.Stat.st_size);
            });

            Loop.Current.Run();
        }
Exemplo n.º 2
0
        public void WriteAndReadFile()
        {
            const string data = "test string";

            var handle = new WriteFileHandle(data);
            handle.OpenWrite(TestFilePath);

            Loop.Current.Run();

            var handle2 = new ReadFileHandle();
            handle2.OpenRead(TestFilePath);

            Loop.Current.Run();

            Assert.AreEqual(data, handle2.Content);
            this.CheckCurrentLoop();
        }
Exemplo n.º 3
0
        public void DeleteFile()
        {
            const string data = "test string";

            var handle = new WriteFileHandle(data);
            handle.OpenWrite(TestFilePath);

            Loop.Current.Run();

            var handle2 = new Filesystem();
            handle2.Delete(TestFilePath, (args) =>
            {
                Assert.IsTrue(args.Successful);
            });

            Loop.Current.Run();
        }
Exemplo n.º 4
0
        public void StatFile()
        {
            const string data = "test string";

            var handle = new WriteFileHandle(data);

            handle.OpenWrite(TestFilePath);

            Loop.Current.Run();

            var handle2 = new Filesystem();

            handle2.Stat(TestFilePath, (args) => {
                Assert.AreEqual(data.Length, args.Stat.st_size);
            });

            Loop.Current.Run();
        }
Exemplo n.º 5
0
        public void CopyFile()
        {
            const string data = "test string";

            var handle = new WriteFileHandle(data);

            handle.OpenWrite(TestFilePath);

            Loop.Current.Run();

            var handle2 = new Filesystem();

            handle2.Copy(TestFilePath, TestFilePath + "copy", (args) =>
            {
                Assert.IsTrue(args.Successful);
            });

            Loop.Current.Run();
        }
Exemplo n.º 6
0
        public void WriteAndReadFile()
        {
            const string data = "test string";

            var handle = new WriteFileHandle(data);

            handle.OpenWrite(TestFilePath);

            Loop.Current.Run();

            var handle2 = new ReadFileHandle();

            handle2.OpenRead(TestFilePath);

            Loop.Current.Run();

            Assert.AreEqual(data, handle2.Content);
            this.CheckCurrentLoop();
        }