@@ -2,42 +2,52 @@ use napi_derive::napi;
2
2
3
3
#[ napi( object) ]
4
4
pub struct GetConnectionStringOptions {
5
- pub container_id_or_name : String ,
6
- pub db_username : Option < String > ,
7
- pub db_password : Option < String > ,
8
- pub verify : Option < bool > ,
5
+ pub container_id_or_name : String ,
6
+ pub db_username : Option < String > ,
7
+ pub db_password : Option < String > ,
8
+ pub verify : Option < bool > ,
9
9
}
10
10
11
11
impl From < GetConnectionStringOptions > for atlas_local:: models:: GetConnectionStringOptions {
12
- fn from ( source : GetConnectionStringOptions ) -> Self {
13
- Self {
14
- container_id_or_name : source. container_id_or_name ,
15
- db_username : source. db_username ,
16
- db_password : source. db_password ,
17
- verify : source. verify ,
18
- }
12
+ fn from ( source : GetConnectionStringOptions ) -> Self {
13
+ Self {
14
+ container_id_or_name : source. container_id_or_name ,
15
+ db_username : source. db_username ,
16
+ db_password : source. db_password ,
17
+ verify : source. verify ,
19
18
}
19
+ }
20
20
}
21
21
22
22
// test
23
23
#[ cfg( test) ]
24
24
mod tests {
25
- use super :: * ;
25
+ use super :: * ;
26
26
27
- #[ test]
28
- fn test_get_connection_string_options ( ) {
29
- let options = GetConnectionStringOptions {
30
- container_id_or_name : "test_container" . into ( ) ,
31
- db_username : Some ( "test_user" . into ( ) ) ,
32
- db_password : Some ( "test_pass" . into ( ) ) ,
33
- verify : Some ( true ) ,
34
- } ;
27
+ #[ test]
28
+ fn test_get_connection_string_options ( ) {
29
+ let options = GetConnectionStringOptions {
30
+ container_id_or_name : "test_container" . into ( ) ,
31
+ db_username : Some ( "test_user" . into ( ) ) ,
32
+ db_password : Some ( "test_pass" . into ( ) ) ,
33
+ verify : Some ( true ) ,
34
+ } ;
35
35
36
- let get_connection_string_options: atlas_local:: models:: GetConnectionStringOptions = options. into ( ) ;
36
+ let get_connection_string_options: atlas_local:: models:: GetConnectionStringOptions =
37
+ options. into ( ) ;
37
38
38
- assert_eq ! ( get_connection_string_options. container_id_or_name, "test_container" ) ;
39
- assert_eq ! ( get_connection_string_options. db_username, Some ( "test_user" . into( ) ) ) ;
40
- assert_eq ! ( get_connection_string_options. db_password, Some ( "test_pass" . into( ) ) ) ;
41
- assert_eq ! ( get_connection_string_options. verify, Some ( true ) ) ;
42
- }
39
+ assert_eq ! (
40
+ get_connection_string_options. container_id_or_name,
41
+ "test_container"
42
+ ) ;
43
+ assert_eq ! (
44
+ get_connection_string_options. db_username,
45
+ Some ( "test_user" . into( ) )
46
+ ) ;
47
+ assert_eq ! (
48
+ get_connection_string_options. db_password,
49
+ Some ( "test_pass" . into( ) )
50
+ ) ;
51
+ assert_eq ! ( get_connection_string_options. verify, Some ( true ) ) ;
52
+ }
43
53
}
0 commit comments