Exemplo n.º 1
0
        public void GetVendors_ParseAwsVendorInfo_MissingInvalidValues()
        {
            var json = @"{
							""instanceId"" : ""i-1234567890abcdef0"",
							""instanceType"" : ""t1.$micro""
						}"                        ;

            var vendorInfo = new VendorInfo(_configuration, _agentHealthReporter, _environment, _vendorHttpApiRequestor);
            var model      = (AwsVendorModel)vendorInfo.ParseAwsVendorInfo(json);

            Assert.IsNull(model);
        }
Exemplo n.º 2
0
        public void GetVendors_ParseAwsVendorInfo_InvalidJson()
        {
            var json = @"{  I am not valid json. Deal with it.
							""availabilityZone"" : ""us - east - 1d"",
							""instanceId"" : ""i-1234567890abcdef0"",
							""instanceType"" : ""t1.micro""
						}"                        ;

            var vendorInfo = new VendorInfo(_configuration, _agentHealthReporter, _environment, _vendorHttpApiRequestor);
            var model      = vendorInfo.ParseAwsVendorInfo(json);

            Assert.Null(model);
        }
Exemplo n.º 3
0
        public void GetVendors_ParseAwsVendorInfo_Complete()
        {
            var json = @"{
							""availabilityZone"" : ""us - east - 1d"",
							""instanceId"" : ""i-1234567890abcdef0"",
							""instanceType"" : ""t1.micro""
						}"                        ;

            var vendorInfo = new VendorInfo(_configuration, _agentHealthReporter, _environment, _vendorHttpApiRequestor);
            var model      = (AwsVendorModel)vendorInfo.ParseAwsVendorInfo(json);

            Assert.NotNull(model);
            Assert.True(model.InstanceId == "i-1234567890abcdef0");
            Assert.True(model.InstanceType == "t1.micro");
            Assert.True(model.AvailabilityZone == "us - east - 1d");
        }