// Copyright (C) Stichting Deltares 2017. All rights reserved.
//
// This file is part of Ringtoets.
//
// Ringtoets is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
//
// All names, logos, and references to "Deltares" are registered trademarks of
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
using System;
using AssemblyTool.Kernel;
using AssemblyTool.Kernel.Assembly;
using AssemblyTool.Kernel.Assembly.CalculatorInput;
using AssemblyTool.Kernel.Data.AssemblyCategories;
using AssemblyTool.Kernel.Data.CalculationResults;
namespace Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Kernels.Assembly
{
///
/// Failure mechanism section assembly kernel stub for testing purposes.
///
public class FailureMechanismSectionAssemblyKernelStub : IFailureMechanismSectionAssemblyCalculator
{
///
/// Gets the input used in .
///
public SimpleCalculationResult? SimpleAssessmentFailureMechanismsInput { get; private set; }
///
/// Gets the input used in .
///
public SimpleCalculationResultValidityOnly? SimpleAssessmentFailureMechanismsValidityOnlyInput { get; private set; }
///
/// Gets the input used in .
///
public DetailedCalculationInputFromProbability DetailedAssessmentFailureMechanismFromProbabilityInput { get; private set; }
///
/// Gets the input used in .
///
public DetailedCalculationInputFromProbabilityWithLengthEffect DetailedAssessmentFailureMechanismFromProbabilityWithLengthEffectInput { get; private set; }
///
/// Gets a value indicating whether a calculation was called or not.
///
public bool Calculated { get; private set; }
///
/// Indicator whether an exception must be thrown when performing a calculation.
///
public bool ThrowExceptionOnCalculate { private get; set; }
///
/// Gets or sets the failure mechanism section assembly category result.
///
public CalculationOutput FailureMechanismSectionAssemblyCategoryResult { get; set; }
///
/// Gets or sets the failure mechanism section assembly category group.
///
public CalculationOutput FailureMechanismSectionAssemblyCategoryGroup { get; set; }
///
/// Gets the simple assessment input used in
///
public FailureMechanismSectionAssemblyCategoryResult CombinedSimpleAssessmentInput { get; private set; }
///
/// Gets the detailed assessment input used in
///
public FailureMechanismSectionAssemblyCategoryResult CombinedDetailedAssessmentInput { get; private set; }
///
/// Gets the tailor made assessment input used in
///
public FailureMechanismSectionAssemblyCategoryResult CombinedTailorMadeAssessmentInput { get; private set; }
///
/// Gets the simple assessment input used in
///
public FailureMechanismSectionCategoryGroup? CombinedSimpleAssessmentGroupInput { get; private set; }
///
/// Gets the detailed assessment input used in
///
public FailureMechanismSectionCategoryGroup? CombinedDetailedAssessmentGroupInput { get; private set; }
///
/// Gets the tailor made assessment input used in
///
public FailureMechanismSectionCategoryGroup? CombinedTailorMadeAssessmentGroupInput { get; private set; }
public CalculationOutput SimpleAssessmentDirectFailureMechanisms(SimpleCalculationResult result)
{
if (ThrowExceptionOnCalculate)
{
throw new Exception("Message", new Exception());
}
SimpleAssessmentFailureMechanismsInput = result;
Calculated = true;
return FailureMechanismSectionAssemblyCategoryResult;
}
public CalculationOutput SimpleAssessmentIndirectFailureMechanisms(SimpleCalculationResult result)
{
throw new NotImplementedException();
}
public CalculationOutput SimpleAssessmentDirectFailureMechanisms(SimpleCalculationResultValidityOnly result)
{
if (ThrowExceptionOnCalculate)
{
throw new Exception("Message", new Exception());
}
SimpleAssessmentFailureMechanismsValidityOnlyInput = result;
Calculated = true;
return FailureMechanismSectionAssemblyCategoryResult;
}
public CalculationOutput DetailedAssessmentDirectFailureMechanisms(DetailedCalculationResult result)
{
throw new NotImplementedException();
}
public CalculationOutput DetailedAssessmentIndirectFailureMechanisms(DetailedCalculationResult result)
{
throw new NotImplementedException();
}
public CalculationOutput DetailedAssessmentDirectFailureMechanisms(DetailedCalculationInputFromProbability input)
{
if (ThrowExceptionOnCalculate)
{
throw new Exception("Message", new Exception());
}
DetailedAssessmentFailureMechanismFromProbabilityInput = input;
Calculated = true;
return FailureMechanismSectionAssemblyCategoryResult;
}
public CalculationOutput DetailedAssessmentDirectFailureMechanisms(DetailedCategoryBoundariesCalculationResult calculationResults)
{
throw new NotImplementedException();
}
public CalculationOutput DetailedAssessmentDirectFailureMechanisms(DetailedCalculationInputFromProbabilityWithLengthEffect input)
{
if (ThrowExceptionOnCalculate)
{
throw new Exception("Message", new Exception());
}
DetailedAssessmentFailureMechanismFromProbabilityWithLengthEffectInput = input;
Calculated = true;
return FailureMechanismSectionAssemblyCategoryResult;
}
public CalculationOutput TailorMadeAssessmentDirectFailureMechanisms(TailorMadeCalculationResult result)
{
throw new NotImplementedException();
}
public CalculationOutput TailorMadeAssessmentIndirectFailureMechanisms(TailorMadeCalculationResult result)
{
throw new NotImplementedException();
}
public CalculationOutput TailorMadeAssessmentDirectFailureMechanisms(TailorMadeCalculationInputFromProbability input)
{
throw new NotImplementedException();
}
public CalculationOutput TailorMadeAssessmentDirectFailureMechanisms(TailorMadeCategoryCalculationResult result)
{
throw new NotImplementedException();
}
public CalculationOutput TailorMadeAssessmentDirectFailureMechanisms(TailorMadeCalculationInputFromProbabilityWithLengthEffectFactor input)
{
throw new NotImplementedException();
}
public CalculationOutput CombinedAssessmentFromFailureMechanismSectionResults(FailureMechanismSectionCategoryGroup resultSimpleAssessment, FailureMechanismSectionCategoryGroup resultDetailedAssessment, FailureMechanismSectionCategoryGroup resultTailorMadeAssessment)
{
if (ThrowExceptionOnCalculate)
{
throw new Exception("Message", new Exception());
}
CombinedSimpleAssessmentGroupInput = resultSimpleAssessment;
CombinedDetailedAssessmentGroupInput = resultDetailedAssessment;
CombinedTailorMadeAssessmentGroupInput = resultTailorMadeAssessment;
Calculated = true;
return FailureMechanismSectionAssemblyCategoryGroup;
}
public CalculationOutput CombinedAssessmentFromFailureMechanismSectionResults(FailureMechanismSectionAssemblyCategoryResult resultSimpleAssessment, FailureMechanismSectionAssemblyCategoryResult resultDetailedAssessment, FailureMechanismSectionAssemblyCategoryResult resultTailorMadeAssessment)
{
if (ThrowExceptionOnCalculate)
{
throw new Exception("Message", new Exception());
}
CombinedSimpleAssessmentInput = resultSimpleAssessment;
CombinedDetailedAssessmentInput = resultDetailedAssessment;
CombinedTailorMadeAssessmentInput = resultTailorMadeAssessment;
Calculated = true;
return FailureMechanismSectionAssemblyCategoryResult;
}
}
}