-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit contains a number of fixes, e.g. a way to create catalogs programmatically (for admins only, for now).
- Loading branch information
Showing
7 changed files
with
282 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#region Copyright and terms of services | ||
|
||
// Copyright (c) 2013-present Meplato GmbH. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
// in compliance with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software distributed under the License | ||
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
// or implied. See the License for the specific language governing permissions and limitations under | ||
// the License. | ||
|
||
#endregion | ||
|
||
using System.Threading.Tasks; | ||
using Meplato.Store2.Catalogs; | ||
using NUnit.Framework; | ||
|
||
namespace Meplato.Store2.Tests.Catalogs | ||
{ | ||
[TestFixture] | ||
public class CreateTests : TestCase | ||
{ | ||
[Test] | ||
public async Task TestCreate() | ||
{ | ||
MockFromFile("catalogs.create.success"); | ||
|
||
var service = GetCatalogsService(); | ||
Assert.NotNull(service); | ||
|
||
var create = new CreateCatalog() | ||
{ | ||
MerchantId = 1, | ||
Name = "test2", | ||
// Description = "", | ||
// ProjectID = 0, | ||
ProjectMpcc = "meplato", | ||
ValidFrom = null, | ||
ValidUntil = null, | ||
Country = "DE", | ||
Currency = "EUR", | ||
Language = "de", | ||
Target = "mall", | ||
SageNumber = "", | ||
SageContract = "" | ||
}; | ||
|
||
var response = await service.Create().Catalog(create).Do(); | ||
Assert.NotNull(response); | ||
Assert.AreEqual("store#catalog", response.Kind); | ||
Assert.AreEqual(81, response.Id); | ||
Assert.AreEqual("48F31F33AD", response.Pin); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
HTTP/1.1 201 Created | ||
Content-Type: application/json; charset=utf-8 | ||
P3p: CP="This is not a P3P policy!" | ||
Vary: Cookie | ||
X-Content-Type-Options: nosniff | ||
X-Frame-Options: SAMEORIGIN | ||
X-Ua-Compatible: IE=edge | ||
X-Xss-Protection: 1; mode=block | ||
Date: Wed, 01 Apr 2015 13:53:54 GMT | ||
|
||
{"kind":"store#catalog","selfLink":"https://store3.go/api/v2/catalogs/48F31F33AD","id":81,"type":"corporate","merchantId":1,"merchantMpcc":"meplato","merchantMpsc":"meplato-sc","merchantName":"Meplato GmbH","projectId":1,"projectMpcc":"meplato","projectMpbc":"meplato","projectName":"Meplato","project":{"id":1,"type":"corporate","mpcc":"meplato","mpbc":"meplato","name":"Meplato","profile":{"nameExists":{"policy":1},"categoriesExists":{"policy":1},"eclassesValid":{"policy":0,"version":"5.1"},"orderUnitValues":{"policy":0},"contentUnitValues":{"policy":0}},"customization":{"hooks":[{"kind":"publish_initial","via":"smtp","target":"oe+dev-initial-publish@meplato.de"}]},"script":"","visible":true,"country":"DE","language":"de","locale":"de_DE","timeZone":"Europe/Berlin","currency":"EUR","ou":"PCE","catalogPriceInitial":0,"catalogPriceRecurring":0,"catalogPriceCurrency":"EUR","catalogPriceInterval":"yearly","target":"mall","companyGroup":"","created":"2017-10-09T14:29:35Z","updated":"2020-01-02T08:47:32Z"},"slug":"test2","name":"test2","pin":"48F31F33AD","validFrom":"2020-03-13","validUntil":"2099-12-31","currency":"EUR","country":"DE","language":"de","state":"idle","created":"2020-03-13T15:39:52.004116159Z","updated":"2020-03-13T15:39:52.004116159Z","lockedForDownload":false,"supportsOciDetail":false,"supportsOciDetailadd":false,"supportsOciValidate":false,"supportsOciSourcing":false,"supportsOciBackgroundsearch":false,"supportsOciQuantitycheck":false,"supportsOciDownloadjson":false,"keepOriginalBlobs":false,"target":"","showImportFailure":false} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.