Ejemplo n.º 1
0
        public static void Implicit_conversion___Should_return_same_double_value_passed_to_constructor___When_converting_to_object_of_type_double()
        {
            // Arrange
            var expectedInt     = Math.Abs(ThreadSafeRandom.NextDouble());
            var systemUnderTest = new PositiveDouble(expectedInt);

            // Act
            double actualInt = systemUnderTest;

            // Assert
            actualInt.Should().Be(expectedInt);
        }
Ejemplo n.º 2
0
        public static void Cast___Should_return_the_same_value_passed_to_constructor___When_casting_to_double()
        {
            // Arrange
            var expectedInt     = Math.Abs(ThreadSafeRandom.NextDouble());
            var systemUnderTest = new PositiveDouble(expectedInt);

            // Act
            var actualInt = (double)systemUnderTest;

            // Assert
            actualInt.Should().Be(expectedInt);
        }
Ejemplo n.º 3
0
        public static void Value___Should_return_the_same_value_passed_to_constructor___When_getting()
        {
            // Arrange
            var expectedDouble  = Math.Abs(ThreadSafeRandom.NextDouble());
            var systemUnderTest = new PositiveDouble(expectedDouble);

            // Act
            var actualInt = systemUnderTest.Value;

            // Assert
            actualInt.Should().Be(expectedDouble);
        }
Ejemplo n.º 4
0
 public Square(double x, double y, PositiveDouble sideLength)
 {
     X          = x;
     Y          = y;
     SideLength = sideLength;
 }
 public Dimensiones(PositiveDouble alto, PositiveDouble ancho, PositiveDouble largo)
 {
     Alto  = new PositiveDouble(alto);
     Ancho = new PositiveDouble(ancho);
     Largo = new PositiveDouble(largo);
 }
Ejemplo n.º 6
0
 public Peso(UnidadPeso unidad, PositiveDouble valor)
 {
     Unidad = unidad;
     Valor  = valor;
 }
 public BloodGlucoseMeasurement(double mmolPerL)
 {
     Value = new PositiveDouble(mmolPerL);
 }