コード例 #1
0
        public void DataAccessStoreAndGetTest()
        {
            var data = new DataAccess.DataBase(Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()));

            data.StoreFile("www.sample.com", "file.txt", @"//Storage/file1.txt", 100, string.Empty, string.Empty, DateTime.Now);
            data.StoreFile("www.sample.com", "file2.txt", @"//Storage/file2.txt", 100, string.Empty, string.Empty, DateTime.Now);
            var files = data.GetFiles(0, 1).ToArray();

            files.Should().NotBeNull();
            files.Count().Should().Be(1);
            var file = files.First();

            file.Should().NotBeNull();
            file.Should().BeOfType <FullFile>();
            file.Name.Should().Be("file.txt");
        }