public static TagTargetReference WithTagInStorageOfType(this Mock<ITagStorageAdapter> storageMock, string tagName, string typeName) { var tagref = new TagTargetReference() { FullTypeName = typeName, Id = Guid.NewGuid() }; storageMock .Setup(x => x.LoadTagMappingsFor(It.Is<TagTargetReference>(r => r.FullTypeName == typeName))) .Returns(new List<TagMapping>() { new TagMapping() { Reference = tagref, Tag = new Tag(tagName) } }); storageMock .Setup(x => x.LoadTagMappingsFor(new Tag(tagName), typeName)) .Returns(new List<TagMapping>() { new TagMapping() { Reference = tagref, Tag = new Tag(tagName) } }); storageMock .Setup(x => x.LoadTagMappingsFor(new Tag(tagName))) .Returns(new List<TagMapping>() { new TagMapping() { Reference = tagref, Tag = new Tag(tagName) } }); return tagref; }
public Tagger(ITagTarget target, ITagStorageAdapter storageAdapter) { _tagTarget = target; _tagStorageAdapter = storageAdapter; _tagTargetReference = new TagTargetReference { FullTypeName = _tagTarget.GetType().FullName, Id = _tagTarget.Id }; _tagMappings = _tagStorageAdapter.LoadTagMappingsFor(_tagTargetReference); }
public void Two_TagTargetReferences_With_Same_Id_And_Name_Are_Considered_Equal() { var aGuid = Guid.NewGuid(); var desOane = new TagTargetReference() { FullTypeName = "aWoas", Id = aGuid }; var desOndre = new TagTargetReference() { FullTypeName = "aWoas", Id = aGuid }; SchauMerMoi.DesPassdScho(desOane, desOndre); }