Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from andrerod/network
Browse files Browse the repository at this point in the history
Add networking UT
  • Loading branch information
anuchandy committed Jul 23, 2013
2 parents de2a0f8 + 98e684e commit f4e4181
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/services/serviceManagement/servicemanagementservice.js
Original file line number Diff line number Diff line change
Expand Up @@ -2112,6 +2112,7 @@ ServiceManagementService.prototype.setNetworkConfig = function (networkConfigura
var outbody = this.serialize.buildNetworkConfiguration(networkConfiguration);
var defaultSerializeType = this.serializetype;
this.serializetype = 'TEXT';

this.performRequest(webResource, outbody, null, function (responseObject, next) {
this.serializetype = defaultSerializeType;
var finalCallback = function (returnObject) {
Expand Down
24 changes: 24 additions & 0 deletions test/recordings/serviceManagement-tests.nock.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions test/services/serviceManagement/servicemanagementservice-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,44 @@ describe('Service Management', function () {
executeTest();
});
});

describe('virtual networks', function () {
it('should set network configuration', function (done) {
var vnetObject = {
VirtualNetworkConfiguration: {
VirtualNetworkSites: [
{
Name: 'test',
AffinityGroup: 'test-ag',
AddressSpace: ['10.0.0.0/20'],
Subnets: [
{
Name: 'sub1',
AddressPrefix: '10.0.0.0/23'
}
]
}
]
}
};

service.setNetworkConfig(vnetObject, function (err, response) {
should.not.exist(err);

done(err);
});
});

it('should get network configuration', function (done) {
service.getNetworkConfig(function (err, response) {
should.not.exist(err);

var configuration = response.body;
configuration.VirtualNetworkConfiguration.VirtualNetworkSites[0].AddressSpace[0].should.equal('10.0.0.0/20');
configuration.VirtualNetworkConfiguration.VirtualNetworkSites[0].Subnets[0].AddressPrefix.should.equal('10.0.0.0/23');

done(err);
});
});
});
});

0 comments on commit f4e4181

Please sign in to comment.