public async Task CreateValidActionRelation()
        {
            var session = await Login();

            using (var client = new HttpClient { BaseAddress = new Uri(ServerUrl) })
            {
                client.AcceptJson().AddSessionHeader(session.Id.ToString());

                var newAction = await CreateTestAction();

                var newAR = new ActionRelation
                {
                    ActionId = newAction.Id,
                    Relationship = 0,
                    ConcernChange = new Matrix { X = 0, Y = 0 },
                    RewardResourceChange = new Matrix { X = 0, Y = 0 }
                };
                var arResponse = await client.PostAsJsonAsync("/api/actions/relations", newAR);
                Assert.Equal(HttpStatusCode.Created, arResponse.StatusCode);

                var action = await arResponse.Content.ReadAsJsonAsync<ActionRelation>();
                Assert.IsType(typeof(ActionRelation), action);
            }
        }
        public async Task UpdateRewardByValidAction()
        {
            var session = await Login();
            var newAction = await CreateTestAction("Verb test" + Guid.NewGuid());

            using (var client = new HttpClient { BaseAddress = new Uri(ServerUrl) })
            {
                client.AcceptJson().AddSessionHeader(session.Id.ToString());

                var newAT = new AttributeType { Name = "testAttribute", DefaultValue = 0f, Type = 0 };
                var atResponse = await client.PostAsJsonAsync("/api/attributes/types", newAT);
                Assert.Equal(HttpStatusCode.Created, atResponse.StatusCode);
                var attribute = await atResponse.Content.ReadAsJsonAsync<AttributeType>();
                var newAR = new ActionRelation
                {
                    ActionId = newAction.Id,
                    Relationship = 0,
                    ConcernChange = new Matrix { X = 0, Y = 0 },
                    RewardResourceChange = new Matrix { X = 0, Y = 0 }
                };
                var arResponse = await client.PostAsJsonAsync("/api/actions/relations", newAR);
                Assert.Equal(HttpStatusCode.Created, arResponse.StatusCode);
                var arReturn = await arResponse.Content.ReadAsJsonAsync<ActionRelation>();
                Assert.IsType(typeof(ActionRelation), arReturn);
                var newReward = new Reward
                {
                    AttributeTypeId = attribute.Id,
                    TypeReward = RewardType.Store,
                    Value = 1.5f,
                    Status = 0,
                    GoalId = newAction.GoalId
                };
                var rewardResponse = await client.PostAsJsonAsync("/api/rewards", newReward);
                Assert.Equal(HttpStatusCode.Created, rewardResponse.StatusCode);
                var newReward2 = new Reward
                {
                    AttributeTypeId = attribute.Id,
                    TypeReward = RewardType.Modify,
                    Value = 1f,
                    Status = 0,
                    GoalId = newAction.GoalId,
                    ActionRelationId = arReturn.Id
                };
                var rewardResponse2 = await client.PostAsJsonAsync("/api/rewards", newReward2);
                Assert.Equal(HttpStatusCode.Created, rewardResponse2.StatusCode);

                var actionForm = new Action { Verb = newAction.Verb };

                var actionResponse = await client.PostAsJsonAsync("/api/actions/send", actionForm);
                Assert.Equal(HttpStatusCode.OK, actionResponse.StatusCode);

                var rewardReturn = await actionResponse.Content.ReadAsJsonAsync<Reward>();
                Assert.IsType(typeof(Reward), rewardReturn);
            }
        }
        public async Task CreateActionRelationWithInvalidActionId()
        {
            var session = await Login();

            using (var client = new HttpClient { BaseAddress = new Uri(ServerUrl) })
            {
                client.AcceptJson().AddSessionHeader(session.Id.ToString());

                var newAR = new ActionRelation
                {
                    ActionId = new Guid(),
                    Relationship = 0,
                    ConcernChange = new Matrix { X = 0, Y = 0 },
                    RewardResourceChange = new Matrix { X = 0, Y = 0 }
                };
                var arResponse = await client.PostAsJsonAsync("/api/actions/relations", newAR);
                Assert.Equal(HttpStatusCode.NotFound, arResponse.StatusCode);

                var content = await arResponse.Content.ReadAsJsonAsync<ApiError>();
                Assert.Equal($"No Action found", content.Error);
            }
        }