Esempio n. 1
0
        public void UpdateAccount()
        {
            var client = new CoreNotifyClient("http://localhost:7071/");
            var result = client.CreateAccountAsync(new Account()
            {
                Name           = "sample-" + StringId.New(4, StringIdRanges.Numeric | StringIdRanges.Upper),
                SendGridApiKey = "whatever"
            }).Result;

            client = new CoreNotifyClient("http://localhost:7071/", result.Name, result.Key);
            client.UpdateAccountAsync(new Account()
            {
                Name   = "new-name-" + StringId.New(4, StringIdRanges.Numeric | StringIdRanges.Upper),
                PlanId = 2
            }).Wait();
        }
Esempio n. 2
0
        public void CreateAccount()
        {
            using (var cn = LocalDb.GetConnection("CoreNotify"))
            {
                cn.Execute(
                    @"DELETE [ak] FROM [dbo].[AccountKey] [ak] INNER JOIN [dbo].[Account] [a] ON [ak].[AccountId]=[a].[Id] WHERE [a].[Name]='hello';
                    DELETE [dbo].[Account] WHERE [Name]='hello'");
            }

            var client = new CoreNotifyClient("http://localhost:7071/");
            var result = client.CreateAccountAsync(new Account()
            {
                Name           = "hello",
                SendGridApiKey = "whatever"
            }).Result;

            Assert.IsTrue(result != null);
        }