public Get ( [ relativePath, string defaultValue ) : string | ||
relativePath | [ | |
defaultValue | string | |
리턴 | string |
public void Get_AutocreateIsFalseEntryDoesntExists_ReturnDefaultValue(Db db,[Content]Item rootItem, string relativePath, string defaultValue) { //Arrange var repository = new DictionaryPhraseRepository(new Dictionary() {Root = rootItem, AutoCreate = false}); //Act var result = repository.Get(relativePath, defaultValue); //Assert result.Should().Be(defaultValue); }
public void Get_DatabaseIsNull_ReturnDefaultValue(string relativePath, string defaultValue) { //Arrange Context.Database = null; var repository = new DictionaryPhraseRepository(new Dictionary()); //Act var result = repository.Get(relativePath, defaultValue); //Assert result.Should().Be(defaultValue); }
public void Get_AutocreateIsTrueEntryDoesntExists_ShouldCreateItem(Db db, [Content]CreateDictionaryEntryServiceTests.DictionaryEntryTemplate entryTemplate, [Content]Item rootItem, IEnumerable<string> pathParts, string defaultValue) { //Arrange var relativePath = string.Join("/", pathParts.Select(ItemUtil.ProposeValidItemName)); var repository = new DictionaryPhraseRepository(new Dictionary() { Root = rootItem, AutoCreate = true }); //Act var result = repository.Get(relativePath, defaultValue); //Assert result.Should().Be(defaultValue); rootItem.Axes.GetItem(relativePath).Should().NotBeNull(); }