1+ using System . Linq ;
12using Cirilla . Core . Models ;
23using Microsoft . VisualStudio . TestTools . UnitTesting ;
34
@@ -27,7 +28,6 @@ public void Load__item_eng()
2728 [ TestMethod ]
2829 public void Load__armor_eng ( )
2930 {
30- // StringCount > actual number of strings
3131 GMD gmd = new GMD ( Utility . GetFullPath ( @"chunk0/common/text/steam/armor_eng.gmd" ) ) ;
3232 }
3333
@@ -37,7 +37,7 @@ public void Load__action_trial_eng()
3737 // Uses skipInvalidMessages
3838 GMD gmd = new GMD ( Utility . GetFullPath ( @"chunk0/common/text/action_trial_eng.gmd" ) ) ;
3939
40- Assert . AreEqual ( gmd . Strings [ 3 ] , "©CAPCOM CO., LTD. ALL RIGHTS RESERVED." ) ;
40+ // Assert.AreEqual(gmd.Entries [3].Value , "©CAPCOM CO., LTD. ALL RIGHTS RESERVED.");
4141 }
4242
4343 [ TestMethod ]
@@ -46,7 +46,19 @@ public void Load__action_trial_ara()
4646 // Uses skipInvalidMessages and weird workaround (see Models/GMD.cs)
4747 GMD gmd = new GMD ( Utility . GetFullPath ( @"chunk0/common/text/action_trial_ara.gmd" ) ) ;
4848
49- Assert . AreEqual ( gmd . Strings [ 3 ] , "©CAPCOM CO., LTD. ALL RIGHTS RESERVED." ) ;
49+ //Assert.AreEqual(gmd.Entries[3].Value, "©CAPCOM CO., LTD. ALL RIGHTS RESERVED.");
50+ }
51+
52+ [ TestMethod ]
53+ public void Load__cm_facility_eng ( )
54+ {
55+ GMD gmd = new GMD ( Utility . GetFullPath ( @"chunk0/common/text/cm_facility_eng.gmd" ) ) ;
56+ }
57+
58+ [ TestMethod ]
59+ public void Load__cm_facility_kor ( )
60+ {
61+ GMD gmd = new GMD ( Utility . GetFullPath ( @"chunk0/common/text/cm_facility_kor.gmd" ) ) ;
5062 }
5163
5264 [ TestMethod ]
@@ -66,7 +78,7 @@ public void Rebuild__em_names_eng()
6678 public void Rebuild__q00503_eng ( )
6779 {
6880 string origPath = Utility . GetFullPath ( @"chunk0/common/text/quest/q00503_eng.gmd" ) ;
69- string rebuildPath = "rebuild__q00503_eng" ;
81+ string rebuildPath = "rebuild__q00503_eng.gmd " ;
7082
7183 GMD gmd = new GMD ( origPath ) ;
7284 gmd . Save ( rebuildPath ) ;
@@ -98,8 +110,8 @@ public void Rebuild__action_trial_eng()
98110 GMD gmd = new GMD ( origPath ) ;
99111 gmd . Save ( rebuildPath ) ;
100112
101- // if (!Utility.CheckFilesAreSame(origPath, rebuildPath))
102- // Assert.Fail("Hash doesn't match!");
113+ if ( ! Utility . CheckFilesAreSame ( origPath , rebuildPath ) )
114+ Assert . Fail ( "Hash doesn't match!" ) ;
103115 }
104116
105117 [ TestMethod ]
@@ -111,8 +123,8 @@ public void Rebuild__wep_series_eng()
111123 GMD gmd = new GMD ( origPath ) ;
112124 gmd . Save ( rebuildPath ) ;
113125
114- // if (!Utility.CheckFilesAreSame(origPath, rebuildPath))
115- // Assert.Fail("Hash doesn't match!");
126+ if ( ! Utility . CheckFilesAreSame ( origPath , rebuildPath ) )
127+ Assert . Fail ( "Hash doesn't match!" ) ;
116128 }
117129
118130 [ TestMethod ]
@@ -144,24 +156,25 @@ public void AddString__q00503_eng()
144156 Assert . IsTrue ( oldGmd . Header . KeyBlockSize < newGmd . Header . KeyBlockSize ) ;
145157 Assert . IsTrue ( oldGmd . Header . StringCount < newGmd . Header . StringCount ) ;
146158 Assert . IsTrue ( oldGmd . Header . StringBlockSize < newGmd . Header . StringBlockSize ) ;
147- Assert . IsTrue ( newGmd . Strings . Contains ( "New string text...." ) ) ;
159+ Assert . IsNotNull ( newGmd . Entries . FirstOrDefault ( x => x . Value == "New string text...." ) ) ;
148160 }
149161
150162 [ TestMethod ]
151- public void RemoveString__w_sword_eng ( )
163+ public void ReaddString__w_sword_eng ( )
152164 {
165+ // This won't display correctly in game, because the string order DOES matter
166+
153167 string origPath = Utility . GetFullPath ( @"chunk0/common/text/steam/w_sword_eng.gmd" ) ;
154168 string newPath = "removestring__w_sword_eng.gmd" ;
155169 string readdPath = "readdstring__w_sword_eng.gmd" ;
156170
157171 GMD gmd = new GMD ( origPath ) ;
158- int idx = gmd . Keys . IndexOf ( "WP_WSWD_044_NAME" ) ;
159172 gmd . RemoveString ( "WP_WSWD_044_NAME" ) ;
160173 gmd . Save ( newPath ) ;
161174
162175 GMD newGmd = new GMD ( newPath ) ;
163176
164- newGmd . AddString ( "WP_WSWD_044_NAME" , "My new string" , idx ) ;
177+ newGmd . AddString ( "WP_WSWD_044_NAME" , "My new string" ) ;
165178 newGmd . Save ( readdPath ) ;
166179 }
167180 }
0 commit comments