public void Payload_WithCorrectCredentialsFromConfig_ReturnSuccess()
        {
            IServerDensityApi api = ServerDensityApi.Initialise();

            var result = api.Metrics.UploadPluginData("4f71c92d004cb602080000f8", GetPayLoad());

            Assert.That(IsSuccess(result), "Failure: " + result);
        }
        public void Initialise_WhenAccountIsNotSet_ThrowsException()
        {
            var settings = new ServerDensitySettings("", "key", new NetworkCredential("u", "p"));

            Assert.Throws <ArgumentException>(() =>
            {
                ServerDensityApi.Initialise(settings);
            });
        }
        public void Initilise_WhenCredentialsNotSet_ThrowsException()
        {
            var settings = new ServerDensitySettings("", "key", null);

            Assert.Throws <ArgumentException>(() =>
            {
                ServerDensityApi.Initialise(settings);
            });
        }
        public void Initilise_WhenApiKeyIsNotSpecified_ThrowsException()
        {
            var settings = new ServerDensitySettings("", "", null);

            Assert.Throws <ArgumentException>(() =>
            {
                ServerDensityApi.Initialise(settings);
            });
        }
 public ServerDensitySubscriber(string deviceId, string agentKey)
 {
     _AgentKey = agentKey;
     _deviceId = deviceId;
     _api      = ServerDensityApi.Initialise();
 }
Пример #6
0
 protected IServerDensityApi GetApi()
 {
     return(ServerDensityApi.Initialise(GetValidSettings(), RequestClientMock.Object));
 }
        public void Version_Returns1point4()
        {
            var api = ServerDensityApi.Initialise(GetValidSettings());

            Assert.That(api.Version, Is.EqualTo("1.4"));
        }