@@ -1375,6 +1375,65 @@ public void Cannot_Publish_Content_Awaiting_Release()
1375
1375
Assert . AreEqual ( PublishResultType . FailedPublishAwaitingRelease , published . Result ) ;
1376
1376
}
1377
1377
1378
+ // V9 - Tests.Integration
1379
+ [ Test ]
1380
+ public void Failed_Publish_Should_Not_Update_Edited_State_When_Edited_True ( )
1381
+ {
1382
+ const int rootNodeId = NodeDto . NodeIdSeed + 2 ;
1383
+
1384
+ // Arrange
1385
+ var contentService = ServiceContext . ContentService ;
1386
+ var content = contentService . GetById ( rootNodeId ) ;
1387
+ contentService . SaveAndPublish ( content ) ;
1388
+
1389
+ content . Properties [ 0 ] . SetValue ( "Foo" , culture : string . Empty ) ;
1390
+ content . ContentSchedule . Add ( DateTime . Now . AddHours ( 2 ) , null ) ;
1391
+ contentService . Save ( content ) ;
1392
+
1393
+ // Act
1394
+ var result = contentService . SaveAndPublish ( content , userId : Constants . Security . SuperUserId ) ;
1395
+
1396
+ // Assert
1397
+ Assert . Multiple ( ( ) =>
1398
+ {
1399
+ Assert . IsFalse ( result . Success ) ;
1400
+ Assert . IsTrue ( result . Content . Published ) ;
1401
+ Assert . AreEqual ( PublishResultType . FailedPublishAwaitingRelease , result . Result ) ;
1402
+
1403
+ // We changed property data
1404
+ Assert . IsTrue ( result . Content . Edited , "result.Content.Edited" ) ;
1405
+ } ) ;
1406
+ }
1407
+
1408
+ // V9 - Tests.Integration
1409
+ [ Test ]
1410
+ public void Failed_Publish_Should_Not_Update_Edited_State_When_Edited_False ( )
1411
+ {
1412
+ const int rootNodeId = NodeDto . NodeIdSeed + 2 ;
1413
+
1414
+ // Arrange
1415
+ var contentService = ServiceContext . ContentService ;
1416
+ var content = contentService . GetById ( rootNodeId ) ;
1417
+ contentService . SaveAndPublish ( content ) ;
1418
+
1419
+ content . ContentSchedule . Add ( DateTime . Now . AddHours ( 2 ) , null ) ;
1420
+ contentService . Save ( content ) ;
1421
+
1422
+ // Act
1423
+ var result = contentService . SaveAndPublish ( content , userId : Constants . Security . SuperUserId ) ;
1424
+
1425
+ // Assert
1426
+ Assert . Multiple ( ( ) =>
1427
+ {
1428
+ Assert . IsFalse ( result . Success ) ;
1429
+ Assert . IsTrue ( result . Content . Published ) ;
1430
+ Assert . AreEqual ( PublishResultType . FailedPublishAwaitingRelease , result . Result ) ;
1431
+
1432
+ // We didn't change any property data
1433
+ Assert . IsFalse ( result . Content . Edited , "result.Content.Edited" ) ;
1434
+ } ) ;
1435
+ }
1436
+
1378
1437
[ Test ]
1379
1438
public void Cannot_Publish_Culture_Awaiting_Release ( )
1380
1439
{
@@ -2176,7 +2235,7 @@ public void Can_Rollback_Version_On_Content()
2176
2235
contentService . Save ( rollback2 ) ;
2177
2236
2178
2237
Assert . IsTrue ( rollback2 . Published ) ;
2179
- Assert . IsFalse ( rollback2 . Edited ) ; // all changes cleared!
2238
+ Assert . IsTrue ( rollback2 . Edited ) ; // Still edited, change of behaviour
2180
2239
2181
2240
Assert . AreEqual ( "Jane Doe" , rollback2 . GetValue < string > ( "author" ) ) ;
2182
2241
Assert . AreEqual ( "Text Page 2 ReReUpdated" , rollback2 . Name ) ;
@@ -2195,7 +2254,7 @@ public void Can_Rollback_Version_On_Content()
2195
2254
content . CopyFrom ( rollto ) ;
2196
2255
content . Name = rollto . PublishName ; // must do it explicitely AND must pick the publish one!
2197
2256
contentService . Save ( content ) ;
2198
- Assert . IsFalse ( content . Edited ) ;
2257
+ Assert . IsTrue ( content . Edited ) ; // Still edited, change of behaviour
2199
2258
Assert . AreEqual ( "Text Page 2 ReReUpdated" , content . Name ) ;
2200
2259
Assert . AreEqual ( "Jane Doe" , content . GetValue ( "author" ) ) ;
2201
2260
}
0 commit comments