Пример #1
0
        public async Task ValidateRickTravels()
        {
            // Criar o Rick
            var rick = await rickService.Create("W-584");

            //Cria as Dimensões para Viajar

            var qy58 = await rickService.CreateDimension("QY-58");

            var qy589 = await rickService.CreateDimension("QY-589");

            // Registra as Viagens
            await travelService.Create(rick.Id, qy58.Id);

            await travelService.Create(rick.Id, qy589.Id);

            rick = await rickService.GetRick(rick.Id);

            Assert.IsNotNull(rick.Travels);
            Assert.AreEqual(2, rick.Travels.Count);
            Assert.AreEqual("QY-58", rick.Travels[0].Dimension.Name);
            Assert.AreEqual("QY-589", rick.Travels[1].Dimension.Name);
        }
Пример #2
0
    // Should move this to another class
    private void AddServices(GameObject gameObject)
    {
        var services = aiData.GetServices();

        // Give all Npc's persuasion
        PersuasionService.Create(gameObject);

        foreach (var service in services)
        {
            switch (service)
            {
            case Service.Barter:
                BarterService.Create(gameObject);
                break;

            case Service.Enchanting:
                EnchantingService.Create(gameObject);
                break;

            case Service.Repair:
                RepairService.Create(gameObject);
                break;

            case Service.Spellmaking:
                SpellmakingService.Create(gameObject);
                break;

            case Service.Spells:
                SpellService.Create(gameObject);
                break;

            case Service.Training:
                TrainingService.Create(gameObject);
                break;
            }
        }

        if (destinationData != null && destinationData.Count > 0)
        {
            TravelService.Create(gameObject);
        }
    }
Пример #3
0
 public void ValidateDimensionExists()
 {
     Assert.ThrowsAsync <ArgumentException>(async() => { await travelService.Create(0, 0); });
 }
Пример #4
0
 public async Task <ApplicationResult> Create(TravelDto travelDto)
 {
     return(await RickLocationUtil.CallService <Travel>("sucess",
                                                        String.Format("Erro inesperado ao Realizar viagem para o rick {0}", travelDto.RickId),
                                                        async() => { return await travelService.Create(travelDto.RickId, travelDto.DimensionId); }));
 }