public void LengthFromDna_InvalidDna_ThrowsException() { // Arrange // Arrange var dna = new QuantityDna { QuantityType = (QuantityType)ushort.MaxValue, UnitType = ushort.MaxValue }; // Act and assert Assert.Throws <ArgumentException>(() => QuantityFactory.LengthFromDna(dna, 0)); }
public void LengthFromDna_ValidDna_CreatesQuantity(QuantityType type, ushort unitType, Type expectedType) { // Arrange var dna = new QuantityDna { QuantityType = type, UnitType = unitType }; // Act var result = QuantityFactory.LengthFromDna(dna, 0); // Assert Assert.That(result.GetType(), Is.EqualTo(expectedType)); }