public void GivenBoolProperty_WhenGetStructuredData_ThenReturnsCorrectValue()
        {
            var serviceLocator = Substitute.For <IServiceLocator>();

            serviceLocator.TryGetExistingInstance(typeof(IPropertyHandler <bool>), out var _).Returns(x =>
            {
                x[1] = new BoolPropertyHandler(_contentSerializerSettings);
                return(true);
            });
            ServiceLocator.SetLocator(serviceLocator);
            var page = new StandardPageBuilder().WithPrivate(true).Build();

            var result = this._sut.GetStructuredData(page, this._contentSerializerSettings);

            result.ShouldContain(x => x.Key.Equals(nameof(StandardPage.Private)) && x.Value.Equals(page.Private));
        }
 public BoolPropertyHandlerTests()
 {
     this._sut = new BoolPropertyHandler(new ContentSerializerSettings());
 }
Ejemplo n.º 3
0
 public BoolPropertyHandlerTests()
 {
     this._sut = new BoolPropertyHandler();
 }