Ejemplo n.º 1
0
        public async void AddCatch()
        {
            Response <List <FishType> > allFishTypes = await _fishingTripManager.GetAllFishTypes();

            _catch.FishType = allFishTypes.Content[0];
            Response <Catch> createdCatch = await _fishingTripManager.CreateCatch(_catch);

            Response <FishingTrip> createdFishingTrip = await _fishingTripManager.CreateFishingTrip(_fishingTrip);

            Assert.True(createdFishingTrip.Content.Catches.Count == 0);
            Response <FishingTrip> addedCatchFishingTrip =
                await _fishingTripManager.AddCatch(createdFishingTrip.Content, createdCatch.Content);

            Response <FishingTrip> updatedFishingTrip =
                await _fishingTripManager.GetFishingTrip(addedCatchFishingTrip.Content);

            Assert.True(updatedFishingTrip.Content.Catches.Count == 1);
        }
Ejemplo n.º 2
0
        private async Task SaveCatch()
        {
            FishingTripManager     manager = new FishingTripManager();
            Response <FishingTrip> response;

            if (IsEdit)
            {
                response = await manager.UpdateCatch(FishingTrip, Catch);
            }
            else
            {
                response = await manager.AddCatch(FishingTrip, Catch);
            }

            InformUserHelper <FishingTrip> informer =
                new InformUserHelper <FishingTrip>(response, this);

            informer.InformUserOfResponse();
            Caller.RefreshList(response.Content);
        }