public void When_UpdateGroupName_Expect_GroupUpdate()
        {
            var errorMessage    = string.Empty;
            var guid            = Guid.NewGuid().ToString();
            var newGroupCommand = new CreateGroupCommand()
            {
                Group = new Group()
                {
                    Name = guid, CurrentCapacity = 100M
                }
            };
            var actionResult = _groupController.Create(newGroupCommand);

            var createdGroup = ActionResultParser.ParseCreatedResult <Group>(actionResult, out errorMessage);

            CheckErrorMessage(errorMessage);

            if (createdGroup.Id == 0)
            {
                Assert.Fail();
            }

            var newGuid            = Guid.NewGuid().ToString();
            var groupUpdateCommand = new UpdateGroupCommand()
            {
                Group = new Group()
                {
                    Id = createdGroup.Id, CurrentCapacity = createdGroup.CurrentCapacity, Name = newGuid
                }
            };

            actionResult = _groupController.Update(groupUpdateCommand);

            var updatedGroup = ActionResultParser.ParseOkObjectResult <Group>(actionResult, out errorMessage);

            CheckErrorMessage(errorMessage);

            Assert.AreEqual(newGuid, updatedGroup.Name);

            DeleteGroup(updatedGroup);
        }
        public void When_UpdateChargeStation_Expect_ChargeStationUpdate()
        {
            var errorMessage = string.Empty;

            var createdGroup = CreateGroup();

            var guid = Guid.NewGuid().ToString();
            var newChargeStationCommand = new CreateChargeStationCommand()
            {
                ChargeStation = new ChargeStation()
                {
                    Name = guid, GroupId = createdGroup.Id
                }
            };

            var actionResult = _chargeStationController.Create(newChargeStationCommand);

            var createdChargeStation = ActionResultParser.ParseCreatedResult <ChargeStation>(actionResult, out errorMessage);

            CheckErrorMessage(errorMessage);

            var newGuid = Guid.NewGuid().ToString();
            var updateChargeStationCommand = new UpdateChargeStationCommand()
            {
                ChargeStation = new ChargeStation()
                {
                    Id = createdChargeStation.Id, GroupId = createdChargeStation.GroupId, Name = newGuid
                }
            };

            actionResult = _chargeStationController.Update(updateChargeStationCommand);

            var updatedChargeStation = ActionResultParser.ParseOkObjectResult <ChargeStation>(actionResult, out errorMessage);

            CheckErrorMessage(errorMessage);

            Assert.AreNotEqual(createdChargeStation.Name, updatedChargeStation.Name);

            DeleteGroup(createdGroup);
        }