public void DocumentFieldConversions() { var media = new Data.Media() { Id = Guid.NewGuid() }; Piranha.Extend.Fields.DocumentField field = media; Assert.Equal(media.Id, field.Id.Value); }
public void DocumentFieldConversionsNullDocument() { var id = Guid.NewGuid(); Piranha.Extend.Fields.DocumentField field = id; Assert.Equal(id, field.Id.Value); string url = field; Assert.Equal("", url); }
public async Task DocumentFieldInitMissing() { using (var api = CreateApi()) { var field = new Piranha.Extend.Fields.DocumentField { Id = Guid.NewGuid() }; await field.Init(api); Assert.Null(field.Id); } }
public void DocumentFieldInitMissing() { using (var api = new Api(GetDb(), new ContentServiceFactory(services), storage)) { var field = new Piranha.Extend.Fields.DocumentField { Id = Guid.NewGuid() }; field.Init(api); Assert.Null(field.Id); } }
public void DocumentFieldNotEquals() { var field1 = new Piranha.Extend.Fields.DocumentField { Id = Guid.NewGuid() }; var field2 = new Piranha.Extend.Fields.DocumentField { Id = null }; Assert.True(field1 != field2); Assert.True(!field1.Equals(field2)); Assert.True(!field1.Equals((object)field2)); }