Files
Christoph Schwörer f045b99a25 Codebasis als Dateien ins Arbeitsrepo statt als Gitlink
QuellCode/CentronERP war nur als Gitlink (Submodul-Referenz auf 79c1142)
getrackt, ohne .gitmodules und ohne erreichbares Remote. Der
Untersuchungsgegenstand der Versuchsreihe war damit nicht reproduzierbar
gesichert: Ein Klon haette ein leeres Verzeichnis erhalten, und die Belege
der 3.287 Anforderungen waeren nicht ueberpruefbar gewesen.

Umstellung:
- Historie nach c:\DEV\CentronERP_git_snapshot_79c1142 ausgelagert
  (vollstaendig lesbar, enthaelt 79c1142 und Vorgaenger 89ccfd6)
- Gitlink aus dem Index entfernt
- Dateiinhalt aufgenommen: 24.557 Dateien, rund 333 MB

Die verschachtelte .gitignore der Codebasis gilt weiter, Build-Artefakte
bleiben ausgeschlossen. Details in Versuche/Versuch_01/_Codebasis-Nachweis.md
2026-08-26 07:43:51 +02:00

35 lines
1.2 KiB
C#

using Centron.Interfaces.DataExchange.BookKeeping;
using Centron.Tests.EndToEnd.Infrastructure;
using Xunit;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.Tests.OldReceiptPriceCalculation;
public class CalculationUtilTests : CentronTest
{
public CalculationUtilTests(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}
[Theory]
[InlineData(100.0)]
[InlineData(150.0)]
[InlineData(200.0)]
[InlineData(10.0)]
[InlineData(6.8)]
public void Test_CalculationUtils_Back_And_Forth_Calculation(double userEnteredPriceThatIncludesDiscountAlready)
{
const int Discount = 10;
const double CurrencyFactor = 1.0;
const int Precision = 2;
// CalculateBasePrice and CalculateNetPrice are basically the back-and-forth calculation of the same value
// The NetPrice includes the discount, the BasePrice does not
var basePrice = CalculationUtils.CalculateBasePrice(userEnteredPriceThatIncludesDiscountAlready, CurrencyFactor, Discount, Precision);
var displayedPrice = CalculationUtils.CalculateNetPrice(basePrice, CurrencyFactor, Discount, Precision);
Assert.Equal(userEnteredPriceThatIncludesDiscountAlready, displayedPrice);
}
}