public void SearchHttpApiCommand()
        {
            SearchProductProjectionsCommand searchCommand         = new SearchProductProjectionsCommand(new ProductProjectionSearchParameters());
            IHttpApiCommandFactory          httpApiCommandFactory = this.clientFixture.GetService <IHttpApiCommandFactory>();
            IHttpApiCommand httpApiCommand = httpApiCommandFactory.Create(searchCommand);

            Assert.Equal(typeof(SearchHttpApiCommand <ProductProjection>), httpApiCommand.GetType());
        }
        public void CreateHttpApiCommand()
        {
            CreateCommand <Category> createCommand         = new CreateCommand <Category>(new CategoryDraft());
            IHttpApiCommandFactory   httpApiCommandFactory = this.clientFixture.GetService <IHttpApiCommandFactory>();
            IHttpApiCommand          httpApiCommand        = httpApiCommandFactory.Create(createCommand);

            Assert.Equal(typeof(CreateHttpApiCommand <Category>), httpApiCommand.GetType());
        }
Ejemplo n.º 3
0
        public void InStoreCartQueryRequest()
        {
            var command = new QueryCommand <Cart>().InStore("storeKey");
            IHttpApiCommandFactory httpApiCommandFactory = this.clientFixture.GetService <IHttpApiCommandFactory>();
            IHttpApiCommand        httpApiCommand        = httpApiCommandFactory.Create(command);

            HttpRequestMessage httpRequestMessage = httpApiCommand.HttpRequestMessage;

            Assert.Equal(HttpMethod.Get, httpRequestMessage.Method);
            Assert.Equal("in-store/key=storeKey/carts?withTotal=false", httpRequestMessage.RequestUri.ToString());

            Assert.Equal(typeof(InStoreHttpApiCommand <PagedQueryResult <Cart> >), httpApiCommand.GetType());
        }
Ejemplo n.º 4
0
        public void InStoreCustomerInStoreSignInRequest()
        {
            var command = new LoginCustomerCommand("*****@*****.**", "password").InStore("storeKey");

            IHttpApiCommandFactory httpApiCommandFactory = this.clientFixture.GetService <IHttpApiCommandFactory>();
            IHttpApiCommand        httpApiCommand        = httpApiCommandFactory.Create(command);

            HttpRequestMessage httpRequestMessage = httpApiCommand.HttpRequestMessage;

            Assert.Equal(HttpMethod.Post, httpRequestMessage.Method);
            Assert.Equal("in-store/key=storeKey/login", httpRequestMessage.RequestUri.ToString());

            Assert.Equal(typeof(InStoreHttpApiCommand <SignInResult <Customer> >), httpApiCommand.GetType());
        }
Ejemplo n.º 5
0
        public void InStoreCartByIdRequest()
        {
            var command = new GetByIdCommand <Cart>("2bafc816-4223-4ff0-ac8a-0f08a8f29fd6").InStore("storeKey");

            IHttpApiCommandFactory httpApiCommandFactory = this.clientFixture.GetService <IHttpApiCommandFactory>();
            IHttpApiCommand        httpApiCommand        = httpApiCommandFactory.Create(command);

            HttpRequestMessage httpRequestMessage = httpApiCommand.HttpRequestMessage;

            Assert.Equal(HttpMethod.Get, httpRequestMessage.Method);
            Assert.Equal("in-store/key=storeKey/carts/2bafc816-4223-4ff0-ac8a-0f08a8f29fd6", httpRequestMessage.RequestUri.ToString());

            Assert.Equal(typeof(InStoreHttpApiCommand <Cart>), httpApiCommand.GetType());
        }