File tree Expand file tree Collapse file tree 4 files changed +25
-1
lines changed Expand file tree Collapse file tree 4 files changed +25
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ alwaysApply: true
3
+ ---
4
+
5
+ - Use Docker for local development
6
+ - Run tests with `docker-compose run --rm package bash -c "dotnet test && dotnet format --verbosity normal --verify-no-changes"`
Original file line number Diff line number Diff line change 27
27
- name : Build
28
28
run : dotnet build --configuration Release --no-restore
29
29
- name : Meilisearch (latest version) setup with Docker
30
+ env :
31
+ # Any docker tag is actually accepted as a valid version
32
+ MEILISEARCH_VERSION : latest
30
33
run : docker compose up -d
31
34
- name : Run tests
32
35
run : dotnet test --no-restore --verbosity normal
Original file line number Diff line number Diff line change @@ -11,9 +11,13 @@ public class IndexSwap
11
11
[ JsonPropertyName ( "indexes" ) ]
12
12
public List < string > Indexes { get ; private set ; }
13
13
14
- public IndexSwap ( string indexA , string indexB )
14
+ [ JsonPropertyName ( "rename" ) ]
15
+ public bool Rename { get ; set ; } = false ;
16
+
17
+ public IndexSwap ( string indexA , string indexB , bool rename = false )
15
18
{
16
19
this . Indexes = new List < string > { indexA , indexB } ;
20
+ this . Rename = rename ;
17
21
}
18
22
}
19
23
}
Original file line number Diff line number Diff line change @@ -22,6 +22,17 @@ public void CreateExpectedJSONFormat()
22
22
23
23
var json = JsonSerializer . Serialize ( swap ) ;
24
24
Assert . Contains ( "\" indexes\" :[\" indexA\" ,\" indexB\" ]" , json ) ;
25
+ Assert . Contains ( "\" rename\" :false" , json ) ;
26
+ }
27
+
28
+ [ Fact ]
29
+ public void CreateExpectedJSONFormatWithRenameTrue ( )
30
+ {
31
+ var swap = new IndexSwap ( "indexA" , "indexB" , rename : true ) ;
32
+
33
+ var json = JsonSerializer . Serialize ( swap ) ;
34
+ Assert . Contains ( "\" indexes\" :[\" indexA\" ,\" indexB\" ]" , json ) ;
35
+ Assert . Contains ( "\" rename\" :true" , json ) ;
25
36
}
26
37
}
27
38
}
You can’t perform that action at this time.
0 commit comments