Creates and fulfills item statistics fields for all the item languages. The fields included are 'Created', 'CreatedBy', 'Revision', 'Updated' and 'UpdatedBy'.

The 'Created' and 'Updated' fields are set to the current date in ISO format. The 'CreatedBy' and 'UpdatedBy' fields store the current user name. The 'Revision' field is a System.Guid generated for each of the item languages.

    public void ProcessSetsValidRevision(
      SetStatistics sut,
      [Frozen] DbItem item,
      AddDbItemArgs args,
      ID id,
      string value)
    {
      var field = new DbField(id) { { "en", value } };
      item.Fields.Add(field);

      sut.Process(args);
      var actual = item.Fields[FieldIDs.Revision].GetValue("en", 0);

      Assert.True(ID.IsID(actual));
    }
    public void ProcessSetsSameCreateAndUpdateInfoForAllLanguages(
      string statisticField,
      SetStatistics sut,
      [Frozen] DbItem item,
      AddDbItemArgs args,
      ID id1,
      ID id2,
      string value1,
      string value2)
    {
      var statisticFieldId = ID.Parse(statisticField);
      var fieldEn = new DbField(id1) { { "en", value1 } };
      var fieldDa = new DbField(id2) { { "da", value2 } };
      item.Fields.Add(fieldEn);
      item.Fields.Add(fieldDa);

      sut.Process(args);
      var valueEn = item.Fields[statisticFieldId].GetValue("en", 0);
      var valueDa = item.Fields[statisticFieldId].GetValue("da", 0);

      valueEn.Should().Be(valueDa);
    }
    public void ProcessSetsUniqueRevisionsForAllLanguages(
      SetStatistics sut,
      [Frozen] DbItem item,
      AddDbItemArgs args,
      ID id1,
      ID id2,
      string value1,
      string value2)
    {
      var fieldEn = new DbField(id1) { { "en", value1 } };
      var fieldDa = new DbField(id2) { { "da", value2 } };
      item.Fields.Add(fieldEn);
      item.Fields.Add(fieldDa);

      sut.Process(args);
      var revisionEn = item.Fields[FieldIDs.Revision].GetValue("en", 0);
      var revisionDa = item.Fields[FieldIDs.Revision].GetValue("da", 0);

      revisionEn.Should().NotBeNullOrEmpty();
      revisionDa.Should().NotBeNullOrEmpty();
      revisionEn.Should().NotBe(revisionDa);
    }
    public void ProcessSetsStatisticsForItemWithoutFieldsInDefaultLanguage(
      string statisticField,
      SetStatistics sut,
      [Frozen] DbItem item,
      AddDbItemArgs args)
    {
      var statisticFieldId = ID.Parse(statisticField);

      sut.Process(args);
      var value = item.Fields[statisticFieldId].GetValue("en", 0);

      value.Should().NotBeNullOrEmpty();
    }