public void TestCreateAssetMissingKey() { var createdBy = "0x9687a70513047dc6Ee966D69bD0C07FFb1102098"; var sdk = new AmbrosusSdk(new AmbrosusSettings()); var assets = sdk.CreateAsset(); }
public void TestGetAssetById() { var sdk = new AmbrosusSdk(new AmbrosusSettings()); var asset = sdk.GetAssetById(_assetId); Assert.IsNotNull(asset); Assert.IsTrue(asset.AssetId == _assetId); }
public void TestGetEventWithDefaultParamters() { var sdk = new AmbrosusSdk(new AmbrosusSettings()); var events = sdk.GetEvents(new EventOptions()); Assert.IsTrue(events.ResultCount > 1); Assert.IsTrue(events.Results.Count > 1); }
public void TestNodeInformation() { var sdk = new AmbrosusSdk(new AmbrosusSettings()); var nodeInfo = sdk.GetNodeInfo(); Assert.IsFalse(string.IsNullOrEmpty(nodeInfo.NodeAddress)); Assert.IsFalse(string.IsNullOrEmpty(nodeInfo.Version)); }
public void TestSdkInstantionation() { var settings = new AmbrosusSettings(); var sdk = new AmbrosusSdk(settings); Assert.IsFalse(string.IsNullOrEmpty(sdk.Settings.ApiEndpoint)); Assert.IsTrue(sdk.Settings.ApiEndpoint == settings.ApiEndpoint); }
public MainPage() { this.InitializeComponent(); _sdk = new AmbrosusSdk(new AmbrosusSettings { }); var info = _sdk.GetNodeInfo(); var asset = _sdk.CreateAsset(); }
public void TestGetAssetWithEmptyParamaters() { var sdk = new AmbrosusSdk(new AmbrosusSettings()); var assets = sdk.GetAssets(new AssetOptions { }); Assert.IsTrue(assets.ResultCount > 1); Assert.IsTrue(assets.Results.Count > 1); }
public void TestGetEventWithInvalidParamters() { var sdk = new AmbrosusSdk(new AmbrosusSettings()); var eve = sdk.GetEvents(new EventOptions { CreatedBy = "0x32423", PerPage = 5, AssetId = "0x3432423", }); }
/// <summary> /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). /// </summary> public App() { this.InitializeComponent(); this.Suspending += OnSuspending; var sdk = new AmbrosusSdk(new AmbrosusSettings { ApiEndpoint = "https://gateway-test.ambrosus.com", }); var nodeinfo = sdk.GetNodeInfo(); }
public void TestGetAssetWithInvalidParamaters() { var createdBy = "0x9687a70518"; var sdk = new AmbrosusSdk(new AmbrosusSettings()); var assets = sdk.GetAssets(new AssetOptions { PerPage = 10, CreatedBy = createdBy }); }
public void TestCreateEventInvalidSecret() { var assetId = "0x525466324f178cef08e25cf69cffde9f149129e4ceddfaa19767bc29705cef56"; var sdk = new AmbrosusSdk(new AmbrosusSettings()); var eve = sdk.CreateEvent(assetId, new List <Datum> { new Datum { Type = EventType.Temperature.Value, AdditionalData = new Dictionary <string, JToken> { { "temperature", "15" } } } }); }
public void TestGetEventWithSpecificParamters() { var assetId = "0x525466324f178cef08e25cf69cffde9f149129e4ceddfaa19767bc29705cef56"; var sdk = new AmbrosusSdk(new AmbrosusSettings()); var events = sdk.GetEvents(new EventOptions { PerPage = 5, AssetId = assetId }); Assert.IsTrue(events.Results.Count == 5); foreach (var eventsResult in events.Results) { Assert.IsTrue(eventsResult.Content.IdData.AssetId == assetId); } }
public void TestGetEventById() { var sdk = new AmbrosusSdk(new AmbrosusSettings()); var eve = sdk.GetEventById(_eventId); Assert.IsTrue(eve.EventId == _eventId); foreach (var datum in eve.Content.Data) { Assert.IsNotNull(datum.AdditionalData); foreach (var d in datum.AdditionalData) { Assert.IsNotNull(d.Key); Assert.IsNotNull(d.Value); } } }
public void TestGetAssetWithParamaters() { var createdBy = "0x9687a70513047dc6Ee966D69bD0C07FFb1102098"; var sdk = new AmbrosusSdk(new AmbrosusSettings()); var assets = sdk.GetAssets(new AssetOptions { PerPage = 10, CreatedBy = createdBy }); Assert.IsTrue(assets.Results.Count == 10); foreach (var assetsResult in assets.Results) { Assert.IsTrue(assetsResult.Content.IdData.CreatedBy == createdBy); } }
public void TestGetAssetWithMissingId() { var sdk = new AmbrosusSdk(new AmbrosusSettings()); var asset = sdk.GetAssetById(""); }
public void TestCreateEventEmptyAssetId() { var sdk = new AmbrosusSdk(new AmbrosusSettings()); var eve = sdk.CreateEvent("", new List <Datum>()); }
public void TestGetAssetWithInvalidAssetId() { var sdk = new AmbrosusSdk(new AmbrosusSettings()); var asset = sdk.GetAssetById("0x34234232"); }
public void TestGetEventWithInvalidId() { var sdk = new AmbrosusSdk(new AmbrosusSettings()); var eve = sdk.GetEventById("0x34234232"); }
public void TestGetEventByWithEmptyId() { var sdk = new AmbrosusSdk(new AmbrosusSettings()); var eve = sdk.GetEventById(""); }
public void TestCreateEventEmptyData() { var assetId = "0x525466324f178cef08e25cf69cffde9f149129e4ceddfaa19767bc29705cef56"; var sdk = new AmbrosusSdk(new AmbrosusSettings()); var eve = sdk.CreateEvent(assetId, new List <Datum>()); }