public void SubmitAnOrder_OppposePublicEndeavour()
        {
            IApiFulfillment impl = new FulfilmentImpl(new GameDataStub());
            List <GameLogicInterfaces.Models.Endeavour> publicEffort = impl.GetPublicEndeavours();

            SubmitOrdersRequestModel orm = new SubmitOrdersRequestModel()
            {
                Orders = new List <OrderRequestModel>()
                {
                    new OpposeEndeavorOrderRequestModel()
                    {
                        IdToOppose         = publicEffort[0].Id,
                        Name               = "Hinder the Sabbat cover-up",
                        MethodOfOpposition = "Pass the information I have to the media",
                        Assets             = new List <string>(),
                        Actors             = new List <string>()
                    }
                }
            };
            List <Order> actual = impl.SubmitOrders(orm, MR_CHARACTER_FIRST_ID);

            Assert.NotNull(actual);
            Assert.Single(actual);
            Assert.NotNull(actual[0].Id);
            Assert.Equal("Hinder the Sabbat cover-up", actual[0].Name);
        }
        public void SubmitAnOrder_SupportPublicEndeavour()
        {
            IApiFulfillment impl = new FulfilmentImpl(new GameDataStub());
            List <GameLogicInterfaces.Models.Endeavour> publicEffort = impl.GetPublicEndeavours();

            SubmitOrdersRequestModel orm = new SubmitOrdersRequestModel()
            {
                Orders = new List <OrderRequestModel>()
                {
                    new SupportEndeavorOrderRequestModel()
                    {
                        IdToSupport     = publicEffort[0].Id,
                        Name            = "Help with the Sabbat cover-up",
                        MethodOfSupport = "Be there in person to help with mental disciplines",
                        Assets          = new List <string>(),
                        Actors          = new List <string>()
                    }
                }
            };
            List <Order> actual = impl.SubmitOrders(orm, MS_CHARACTER_SECOND_ID);

            Assert.NotNull(actual);
            Assert.Single(actual);
            Assert.NotNull(actual[0].Id);
            Assert.Equal("Help with the Sabbat cover-up", actual[0].Name);
        }
        public void SubmitEmptyOrder()
        {
            string                   msCharacterSecondId = "6bcdb901-dab3-4091-a5c9-000000000040";
            IApiFulfillment          impl = new FulfilmentImpl(new GameDataStub());
            SubmitOrdersRequestModel orm  = new SubmitOrdersRequestModel
            {
                Orders = new List <OrderRequestModel>()
            };
            List <Order> actual = impl.SubmitOrders(orm, msCharacterSecondId);

            Assert.Empty(actual);
        }
Beispiel #4
0
        public List <Order> SubmitOrders(SubmitOrdersRequestModel orm, String characterId)
        {
            var response = new List <Order>();

            //TODO send orders to orders repo

            foreach (OrderRequestModel submission in orm.Orders)
            {
                response.Add(MapToPending(submission));
            }

            return(response);
        }
        public void SubmitAnOrder_CreateEndeavour()
        {
            IApiFulfillment          impl = new FulfilmentImpl(new GameDataStub());
            SubmitOrdersRequestModel orm  = new SubmitOrdersRequestModel()
            {
                Orders = new List <OrderRequestModel>()
                {
                    new CreateEndeavorOrderRequestModel()
                    {
                        Name   = "Investigate Arcane Grafitti",
                        Goal   = "Create endeavour to find out more about the obviously arcane writing that has been appearing around Glasgow.",
                        Method = "Task photgraphy students as assignment to capture grafitti, pass the images to my contact at the art museum",
                        Assets = new List <string>(),
                        Actors = new List <string>()
                    }
                }
            };
            List <Order> actual = impl.SubmitOrders(orm, MR_CHARACTER_FIRST_ID);

            Assert.NotNull(actual);
            Assert.Single(actual);
            Assert.NotNull(actual[0].Id);
            Assert.Equal("Investigate Arcane Grafitti", actual[0].Name);
        }