public void ShouldRequireDataStorage()
    {
      // arrange
      var sut = new FakeStandardValuesProvider();

      // act & assert
      sut.Should().BeAssignableTo<IRequireDataStorage>();
    }
    public void ShouldReturnEmptyStringIfNoTemplateFound()
    {
      // arrange
      var storage = Substitute.For<DataStorage>(Database.GetDatabase("master"));
      var field = new Field(ID.NewID, ItemHelper.CreateInstance());
      var sut = new FakeStandardValuesProvider();
      ((IRequireDataStorage)sut).SetDataStorage(storage);

      // act & assert
      sut.GetStandardValue(field).Should().BeEmpty();
    }
    public void ShouldSetDataStorage()
    {
      // arrange
      var storage = Substitute.For<DataStorage>(Database.GetDatabase("master"));
      var sut = new FakeStandardValuesProvider();

      // act
      ((IRequireDataStorage)sut).SetDataStorage(storage);

      // assert
      ((IRequireDataStorage)sut).DataStorage.Should().BeSameAs(storage);
    }
    public void ShouldThrowIfNoDataStorageSet()
    {
      // arrange
      var field = new Field(ID.NewID, ItemHelper.CreateInstance());
      var sut = new FakeStandardValuesProvider();

      // act
      Action action = () => sut.GetStandardValue(field);

      // assert
      action.ShouldThrow<InvalidOperationException>()
            .WithMessage("DataStorage cannot be null.");
    }
 public FakeStandardValuesProviderTest()
 {
   provider = new FakeStandardValuesProvider();
 }
 public void ShouldReturnEmptyStringIfNoTemplateFound(FakeStandardValuesProvider sut, [Greedy]Field field, DataStorageSwitcher switcher)
 {
   // act & assert
   sut.GetStandardValue(field).Should().BeEmpty();
 }