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 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(); }