anchor.diff:            buildStatus: BuildStatus.unknown,
           );
   
  -        whenDocumentSnapshotData().thenReturn(DocumentData.fromMap(buildJson));
  -
  -        await onBuildAddedHandler(documentSnapshotMock, null);
  -
  -        final documentDataMatcher = predicate<DocumentData>((data) {
  -          final operand =
  -              data.getNestedData('successfulBuildsDuration').getInt('operand');
  -          return operand == 0;
  -        });
  -
  -        verify(
  -          documentReferenceMock.setData(argThat(documentDataMatcher), any),
  +        whenDocument().thenReturn(documentReference);
  +        when(documentSnapshot.data).thenReturn(
  +          DocumentData.fromMap(buildJson),
  +        );
  +
  +        await onBuildAddedHandler(documentSnapshot, null);
  +
  +        final successfulDurationIncrementMatcher =
  +            documentFieldIncrementMatcher('successfulBuildsDuration', 0);
  +
  +        verify(
  +          documentReference.setData(
  +            argThat(successfulDurationIncrementMatcher),
  +            any,
  +          ),
           ).called(1);
         },
       );
  
positive.code:     test(
        "does not create a task document if the build day data set successfully",
        () async {
          final buildJson = testDataGenerator.generateBuildJson();
  
          whenDocumentSnapshotData().thenReturn(DocumentData.fromMap(buildJson));
  
          await onBuildAddedHandler(documentSnapshotMock, null);
  
          verifyNever(firestoreMock.collection(tasksCollectionName));
        },
      );
  
      test(
        "creates a task document with 'build_days_created' code if setting the build day's document data fails",
        () async {
          final buildJson = testDataGenerator.generateBuildJson();
  
          whenCreateTaskDocument().thenAnswer((_) => Future.value());
          whenDocumentSnapshotData().thenReturn(DocumentData.fromMap(buildJson));
  
          await onBuildAddedHandler(documentSnapshotMock, null);
  
          final codeMatcher = predicate<DocumentData>(
            (data) => data.getString('code') == TaskCode.buildDaysCreated.value,
          );
  
          verify(taskCollectionReferenceMock.add(argThat(codeMatcher))).called(1);
        },
      );
  
      test(
        "creates a task document with data equals to the build data if setting the build day's document data fails",
        () async {
          final buildJson = testDataGenerator.generateBuildJson();
  
          whenCreateTaskDocument().thenAnswer((_) => Future.value());
          whenDocumentSnapshotData().thenReturn(DocumentData.fromMap(buildJson));
  
          await onBuildAddedHandler(documentSnapshotMock, null);
  
          final dataMatcher = predicate<DocumentData>((data) {
            return const MapEquality().equals(
  
negative.code:           buildStatus: BuildStatus.inProgress,
          );
  
          whenDocument().thenReturn(documentReference);
          when(documentSnapshot.data).thenReturn(
            DocumentData.fromMap(buildJson),
          );
  
          await onBuildAddedHandler(documentSnapshot, null);
  
          final statusFieldIncrementMatcher =
              documentFieldIncrementMatcher(buildDayStatusFieldName, 1);
  
          verify(
            documentReference.setData(
              argThat(statusFieldIncrementMatcher),
              any,
            ),
          ).called(1);
  