fix tests
This commit is contained in:
parent
c8458858e0
commit
0504838691
@ -67,7 +67,6 @@ class FilesApplication : WebApplicationFactory<Program>
|
||||
public class MySetUpClass
|
||||
{
|
||||
protected IServiceScope Scope { get; set; }
|
||||
protected readonly string _pathToProducts = Path.Combine("..", "..", "..", "Data.Test");
|
||||
|
||||
[OneTimeSetUp]
|
||||
public void CreateDb()
|
||||
@ -102,7 +101,7 @@ public class MySetUpClass
|
||||
|
||||
try
|
||||
{
|
||||
Directory.Delete(Path.Combine("..", "..", "..", _pathToProducts), true);
|
||||
Directory.Delete(Path.Combine(Path.Combine("..", "..", "..", "..", "..", "..", "Data.Test")), true);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
@ -81,8 +81,9 @@ public static class DataTests
|
||||
public const int RoomId = 18;
|
||||
public const int RoomIdForDelete = 19;
|
||||
public const int RoomIdForArchive = 20;
|
||||
public const int RoomIdForUnarchive = 22;
|
||||
public const int RoomIdForUnpin = 21;
|
||||
public const int RoomIdForUnarchive = 22;
|
||||
public const int RoomIdWithTags = 24;
|
||||
|
||||
public const string RoomLinkKey = "394892027511.N5UVJ8F6UJPGN0RZKWSOMEYVZVLTZLECGVHHSDSH7ZA";
|
||||
public const string TagNames = "name1,name2";
|
||||
|
@ -126,17 +126,17 @@ public partial class BaseFilesTests
|
||||
public async Task AddTagsById(int id, string tagNames)
|
||||
{
|
||||
var folder = await PutAsync<FolderDto<int>>($"rooms/{id}/tags", JsonContent.Create(new { Names = tagNames.Split(',') }), _options);
|
||||
Assert.IsNotNull(folder.Tags.Count() == 2);
|
||||
Assert.IsTrue(folder.Tags.Count() == 2);
|
||||
}
|
||||
|
||||
[TestCase(DataTests.RoomId, DataTests.TagNames)]
|
||||
[TestCase(DataTests.RoomIdWithTags, DataTests.TagNames)]
|
||||
[Category("Room")]
|
||||
[Order(10)]
|
||||
[Description("delete - rooms/{id}/tags - delete tags by id")]
|
||||
public async Task DeleteTagsById(int id, string tagNames)
|
||||
{
|
||||
var folder = await DeleteAsync<FolderDto<int>>($"rooms/{id}/tags", JsonContent.Create(new { Names = tagNames.Split(',') }), _options);
|
||||
Assert.IsNotNull(folder.Tags.Count() == 0);
|
||||
Assert.IsTrue(folder.Tags.Count() == 0);
|
||||
}
|
||||
|
||||
[TestCase(DataTests.RoomId)]
|
||||
|
@ -336,6 +336,21 @@ public partial class TestFilesMigration : Migration
|
||||
columns: new[] { "folder_id", "parent_id", "level" },
|
||||
values: new object[] { 23, 17, 0 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "files_folder",
|
||||
columns: new[] { "id", "parent_id", "title", "folder_type", "create_by", "create_on", "modified_by", "modified_on", "tenant_id", "foldersCount", "filesCount" },
|
||||
values: new object[] { 24, 17, "Room_Title", 19, "66faa6e4-f133-11ea-b126-00ffeec8b4ef", new DateTime(2021, 8, 4, 11, 1, 4, 513, DateTimeKind.Utc).AddTicks(1842), "66faa6e4-f133-11ea-b126-00ffeec8b4ef", new DateTime(2021, 8, 4, 11, 1, 4, 513, DateTimeKind.Utc).AddTicks(1842), 1, 0, 0 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "files_folder_tree",
|
||||
columns: new[] { "folder_id", "parent_id", "level" },
|
||||
values: new object[] { 24, 24, 0 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "files_folder_tree",
|
||||
columns: new[] { "folder_id", "parent_id", "level" },
|
||||
values: new object[] { 24, 17, 0 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "files_file",
|
||||
columns: new[] {
|
||||
@ -441,6 +456,33 @@ public partial class TestFilesMigration : Migration
|
||||
1, 1, "name1", "66faa6e4-f133-11ea-b126-00ffeec8b4ef", 64
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "files_tag_link",
|
||||
columns: new[]{
|
||||
"tenant_id","tag_id","entry_type","entry_id","create_by","create_on","tag_count",
|
||||
},
|
||||
values: new object[]{
|
||||
1, 1, 1, "24", "66faa6e4-f133-11ea-b126-00ffeec8b4ef", new DateTime(2021, 8, 4, 11, 1, 4, 513, DateTimeKind.Utc).AddTicks(1842), 0
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "files_tag",
|
||||
columns: new[]{
|
||||
"id","tenant_id","name","owner","flag",
|
||||
},
|
||||
values: new object[]{
|
||||
2, 1, "name2", "66faa6e4-f133-11ea-b126-00ffeec8b4ef", 64
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "files_tag_link",
|
||||
columns: new[]{
|
||||
"tenant_id","tag_id","entry_type","entry_id","create_by","create_on","tag_count",
|
||||
},
|
||||
values: new object[]{
|
||||
1, 2, 1, "24", "66faa6e4-f133-11ea-b126-00ffeec8b4ef", new DateTime(2021, 8, 4, 11, 1, 4, 513, DateTimeKind.Utc).AddTicks(1842), 0
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "files_tag",
|
||||
columns: new[]{
|
||||
@ -449,6 +491,7 @@ public partial class TestFilesMigration : Migration
|
||||
values: new object[]{
|
||||
3, 1, "pin", "66faa6e4-f133-11ea-b126-00ffeec8b4ef", 128
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "files_tag_link",
|
||||
columns: new[]{
|
||||
|
Loading…
Reference in New Issue
Block a user