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
import React from 'react'; | |
import { | |
Image as JssImage, | |
Link as JssLink, | |
RichText as JssRichText, | |
ImageField, | |
Field, | |
LinkField, | |
Text, | |
} from '@sitecore-jss/sitecore-jss-nextjs'; |
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
public Language CreateLanguage(string languageName) | |
{ | |
var language = Substitute.For<Language>(); | |
language.CultureInfo.Returns(new CultureInfo(languageName)); | |
language.Name.Returns(languageName); | |
return language; | |
} |
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
public FieldCollection CreateFieldCollection() | |
{ | |
var db = Substitute.For<Database>(); | |
var item = Substitute.For<Item>(ID.NewID, ItemData.Empty, db); | |
var fieldCollection = Substitute.For<FieldCollection>(item); | |
return fieldCollection; | |
} | |
public FieldCollection CreateFieldCollectionByDatabase(Database db) | |
{ |
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
// Sitecore implemented Fields | |
marketMock.TemplateID.Returns(Templates.Market.TemplateID); | |
marketMock.TemplateName.Returns(Templates.Market.TemplateName); | |
marketMock.Name.Returns("Mock Market Item Name"); | |
// Sitecore Item custom fields | |
marketMock[Templates.Market.Fields.MarketName].Returns("Mock Market Name"); | |
marketMock[Templates.Market.Fields.MarketLocation].Returns("Mock Market Location"); | |
// Sitecore Item custom fields - access using .Fields |
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
public void SetChildren(this Item item, ItemList childrenList) | |
{ | |
item.GetChildren().Returns(new ChildList(item, childrenList)); | |
} |
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
public Item CreateItem() | |
{ | |
var db = Substitute.For<Database>(); | |
var item = Substitute.For<Item>(ID.NewID, ItemData.Empty, db); | |
return item; | |
} | |
public Item CreateItemByDatabase(Database db) | |
{ | |
var item = Substitute.For<Item>(ID.NewID, ItemData.Empty, db); |
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
public Field CreateField() | |
{ | |
var db = Substitute.For<Database>(); | |
var item = Substitute.For<Item>(ID.NewID, ItemData.Empty, db); | |
var field = Substitute.For<Field>(ID.NewID, item); | |
return field; | |
} | |
public Field CreateFieldByDatabase(Database db) | |
{ |
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
public Database CreateDatabase() | |
{ | |
var database = Substitute.For<Database>(); | |
return database; | |
} |
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
<form action="api/Confirm"> | |
<input type="text" name="text" /> | |
<input type="submit" name="button" value="Confirm" /> | |
</form> |
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
<form action="api/Confirm"> | |
<input type="text" name="text" /> | |
<input name="__RequestVerificationToken" type="hidden" value="{{sc_getantiforgerytoken}}"> | |
<input type="submit" name="button" value="Confirm" /> | |
</form> |
NewerOlder