public void DeleteFileTest() { FileModel target = new FileModel(); int fileId = 0; int userId = 0; target.DeleteFile(fileId, userId); }
public void ExistTest() { FileModel target = new FileModel(); int directoryId = 3; string fileName = "text2.txt"; int userId = 2; bool expected = true; bool actual = target.Exist(directoryId, fileName, userId); Assert.AreEqual(expected, actual); }
public void CreateFileTest() { FileModel target = new FileModel(); int userId = 2; string name = "text3.txt"; string physicalPath = @"\7d9cf1d0\8deb\4218\a455\6526947ecdda\73725d2c-7209-4bd0-8542-57d83ecd5edb.file"; int directoryId = 1; bool isPublic = false; long size = 4; if (target.Exist(directoryId, name, userId)) { File fileInfo = target.GetFile(directoryId, name, userId); target.DeleteFile(fileInfo.FileId, userId); } target.CreateFile(userId, name, physicalPath, directoryId, isPublic, size); }
public void GetDirectoryFilesTest() { FileModel target = new FileModel(); int directoryId = 3; int userId = 2; List<File> actual = target.GetDirectoryFiles(directoryId, userId); if (actual.Count != 2) Assert.Fail(); }
public void GetFileTest() { FileModel target = new FileModel(); int directoryId = 3; string fileName = "text2.txt"; int userId = 2; File actual = target.GetFile(directoryId, fileName, userId); if (actual.Name != fileName) Assert.Fail(); }