Index: Riskeer/Common/test/Riskeer.Common.Plugin.TestUtil/FileImporters/FailureMechanismSectionResultUpdateStrategyTestFixture.cs =================================================================== diff -u -r1b062cc4b3f0dd11defb95dd7ad5689a595274db -r3f2220c035dd5c0da873fe4994edceafda39b3aa --- Riskeer/Common/test/Riskeer.Common.Plugin.TestUtil/FileImporters/FailureMechanismSectionResultUpdateStrategyTestFixture.cs (.../FailureMechanismSectionResultUpdateStrategyTestFixture.cs) (revision 1b062cc4b3f0dd11defb95dd7ad5689a595274db) +++ Riskeer/Common/test/Riskeer.Common.Plugin.TestUtil/FileImporters/FailureMechanismSectionResultUpdateStrategyTestFixture.cs (.../FailureMechanismSectionResultUpdateStrategyTestFixture.cs) (revision 3f2220c035dd5c0da873fe4994edceafda39b3aa) @@ -46,7 +46,7 @@ } [Test] - public void UpdateSectionResultOld_OriginNull_ThrowsArgumentNullException() + public void UpdateSectionResult_OriginNull_ThrowsArgumentNullException() { // Setup var strategy = new TUpdateStrategy(); @@ -60,7 +60,7 @@ } [Test] - public void UpdateSectionResultOld_TargetNull_ThrowsArgumentNullException() + public void UpdateSectionResult_TargetNull_ThrowsArgumentNullException() { // Setup var strategy = new TUpdateStrategy(); @@ -74,7 +74,7 @@ } [Test] - public void UpdateSectionResultOld_WithData_UpdatesTargetSectionResult() + public void UpdateSectionResult_WithData_UpdatesTargetSectionResult() { // Setup var strategy = new TUpdateStrategy(); @@ -109,91 +109,4 @@ /// and are not equal. protected abstract void AssertSectionResult(TSectionResult originResult, TSectionResult targetResult); } - - /// - /// Test fixture class for testing the behavior of an . - /// - /// The type of the update strategy to test. - /// The type of the old failure mechanism section result the update strategy uses. - /// The type of the failure mechanism section result the update strategy uses. - public abstract class FailureMechanismSectionResultUpdateStrategyTestFixture - : FailureMechanismSectionResultUpdateStrategyTestFixture - where TUpdateStrategy : IFailureMechanismSectionResultUpdateStrategy, new() - where TSectionResultOld : FailureMechanismSectionResultOld - where TSectionResult : FailureMechanismSectionResult - { - [Test] - public void UpdateSectionResult_OriginNull_ThrowsArgumentNullException() - { - // Setup - var strategy = new TUpdateStrategy(); - - // Call - void Call() => strategy.UpdateSectionResultOld(null, CreateEmptySectionResultOld()); - - // Assert - var exception = Assert.Throws(Call); - Assert.AreEqual("origin", exception.ParamName); - } - - [Test] - public void UpdateSectionResult_TargetNull_ThrowsArgumentNullException() - { - // Setup - var strategy = new TUpdateStrategy(); - - // Call - void Call() => strategy.UpdateSectionResultOld(CreateEmptySectionResultOld(), null); - - // Assert - var exception = Assert.Throws(Call); - Assert.AreEqual("target", exception.ParamName); - } - - [Test] - public void UpdateSectionResult_WithData_UpdatesTargetSectionResult() - { - // Setup - var strategy = new TUpdateStrategy(); - TSectionResultOld originResult = CreateConfiguredSectionResultOld(); - TSectionResultOld targetResult = CreateEmptySectionResultOld(); - - // Call - strategy.UpdateSectionResultOld(originResult, targetResult); - - // Assert - AssertSectionResult(originResult, targetResult); - Assert.AreNotSame(originResult.Section, targetResult.Section); - } - - [Test] - public override void Constructor_ExpectedValues() - { - // Call - var strategy = new TUpdateStrategy(); - - // Assert - Assert.IsInstanceOf>(strategy); - } - - /// - /// Creates an empty instance of . - /// - /// An empty . - protected abstract TSectionResultOld CreateEmptySectionResultOld(); - - /// - /// Creates a configured instance of . - /// - /// An empty . - protected abstract TSectionResultOld CreateConfiguredSectionResultOld(); - - /// - /// Asserts whether and - /// are equal. - /// - /// Thrown when - /// and are not equal. - protected abstract void AssertSectionResult(TSectionResultOld originResult, TSectionResultOld targetResult); - } } \ No newline at end of file