@@ -184,6 +184,49 @@ public void UpdateCentreManagerDetails_updates_centre()
184184 }
185185 }
186186
187+ [ Test ]
188+ public void AddCentre_inserts_new_centre ( )
189+ {
190+ using var transaction = new TransactionScope ( ) ;
191+ try
192+ {
193+ // Given
194+ const string centreName = "TestCentre" ;
195+ const string contactFirstName = "TestFirstName" ;
196+ const string contactLastName = "TestLastName" ;
197+ const string contactEmail = "[email protected] " ; 198+ const string contactTelephone = "0123456789" ;
199+ const string registrationEmail = "[email protected] " ; 200+
201+ // When
202+ int insertedID = centresDataService . AddCentreForSuperAdmin ( centreName , contactFirstName , contactLastName ,
203+ contactEmail , contactTelephone , 1 , 1 , registrationEmail , "194.176.105" , true , true ) ;
204+ var insertedCentre = centresDataService . GetCentreDetailsById ( insertedID ) ! ;
205+
206+ // Then
207+ using ( new AssertionScope ( ) )
208+ {
209+ insertedCentre . CentreName . Should ( ) . BeEquivalentTo ( centreName ) ;
210+ insertedCentre . ContactForename . Should ( ) . BeEquivalentTo ( contactFirstName ) ;
211+ insertedCentre . ContactSurname . Should ( ) . BeEquivalentTo ( contactLastName ) ;
212+ insertedCentre . ContactEmail . Should ( ) . BeEquivalentTo ( contactEmail ) ;
213+ insertedCentre . ContactTelephone . Should ( ) . BeEquivalentTo ( contactTelephone ) ;
214+ insertedCentre . CentreType . Should ( ) . BeEquivalentTo ( "NHS Organisation" ) ;
215+ insertedCentre . RegionName . Should ( ) . BeEquivalentTo ( "East Midlands" ) ;
216+ insertedCentre . RegistrationEmail . Should ( ) . BeEquivalentTo ( registrationEmail ) ;
217+ insertedCentre . ShowOnMap . Should ( ) . Be ( true ) ;
218+ insertedCentre . IpPrefix . Should ( ) . BeEquivalentTo ( "194.176.105" ) ;
219+ insertedCentre . CmsAdministratorSpots . Should ( ) . Be ( 5 ) ;
220+ insertedCentre . ContractType . Should ( ) . BeEquivalentTo ( "Basic" ) ;
221+ insertedCentre . TrainerSpots . Should ( ) . Be ( 0 ) ;
222+ }
223+ }
224+ finally
225+ {
226+ transaction . Dispose ( ) ;
227+ }
228+ }
229+
187230 [ Test ]
188231 public void UpdateCentreWebsiteDetails_updates_centre ( )
189232 {
0 commit comments