Skip to content

Commit

Permalink
added a unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-plevako-badoo committed Sep 6, 2020
1 parent 0e108f2 commit 7756c99
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Server/CBXCUITestServer.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ - (instancetype)init_private {

[_server setTXTRecordDictionary:capabilities];
[self registerRoutes];
[self setServerPort];
}
return self;
}
Expand Down Expand Up @@ -93,8 +94,6 @@ - (void)start {
NSError *error;
BOOL serverStarted = NO;

[self setServerPort];

DDLogDebug(@"Attempting to start the DeviceAgent server");
serverStarted = [self attemptToStartWithError:&error];

Expand Down
6 changes: 6 additions & 0 deletions TestApp/DeviceAgentUnitTests/CBXUITestServerTest.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

#import "CBXServerUnitTestUmbrellaHeader.h"
#import "CBXCUITestServer.h"
#import "CBXConstants.h"
#import <OCMock/OCMock.h>
#import "RoutingHTTPServer.h"

@interface CBXCUITestServer (CBXTEST)
Expand Down Expand Up @@ -43,4 +45,8 @@ - (void)testInitPrivateSetsServerAndRegistersRoutes {
expect(self.testServer.isFinishedTesting).to.equal(NO);
}

-(void)testInitSetsDefaultPort {
expect(self.testServer.server.port).equal(CBX_DEFAULT_SERVER_PORT);
}

@end

0 comments on commit 7756c99

Please sign in to comment.