Sitecore.FakeDb.Data.DataProviders.FakeDataProvider.SetProperty C# (CSharp) Method

SetProperty() public method

Sets the property.
public SetProperty ( string name, string value, Sitecore.Data.DataProviders.CallContext context ) : bool
name string The property name.
value string The property value.
context Sitecore.Data.DataProviders.CallContext The context. Ignored.
return bool
    public override bool SetProperty(string name, string value, CallContext context)
    {
      Assert.ArgumentNotNull(name, "name");
      var currentProp = this.properties.Value;
      if (currentProp == null)
      {
        this.properties.Value = new Dictionary<string, string> { { name, value } };
      }
      else
      {
        this.properties.Value[name] = value;
      }

      return true;
    }

Usage Example

 public void ShouldResetPropertyAndReturnTheLatestValue(FakeDataProvider sut, string name, string value1, string value2, CallContext context)
 {
   sut.SetProperty(name, value1, context);
   sut.SetProperty(name, value2, context);
   sut.GetProperty(name, context).Should().Be(value2);
 }
All Usage Examples Of Sitecore.FakeDb.Data.DataProviders.FakeDataProvider::SetProperty