Ejemplo n.º 1
0
        public void Divide_Aover1_ReturnsA()
        {
            // Arrange
            IDimension        a         = CreateStubDimension("a");
            CompoundDimension dimension = new CompoundDimension(a);

            // Act
            IDimension result = dimension.Divide(Dimsensionless.Instance);

            // Assert
            Assert.AreSame(a, result);
        }
Ejemplo n.º 2
0
        public void Divide_AoverB_ReturnsCompoundUnit()
        {
            // Arrange
            IDimension        a         = CreateStubDimension("a");
            IDimension        b         = CreateStubDimension("b");
            CompoundDimension dimension = new CompoundDimension(a);

            // Act
            IDimension result = dimension.Divide(b);

            // Assert
            Assert.IsInstanceOf(typeof(CompoundDimension), result);
        }
Ejemplo n.º 3
0
        public void Multiply_AoverBxB_ReturnsA()
        {
            // Arrange
            IDimension        a    = CreateStubDimension("a");
            IDimension        b    = CreateStubDimension("b");
            CompoundDimension unit = new CompoundDimension(a);

            unit = (CompoundDimension)unit.Divide(b);

            // Act
            IDimension result = unit.Multiply(b);

            // Assert
            Assert.AreSame(a, result);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Divide the current dimension with the dimension(s) given.
 /// </summary>
 /// <param name="dimensions">One or more dimensions.</param>
 public DimensionCreator Divide(params IDimension[] dimensions)
 {
     UpdateDimension(_dimension.Divide(dimensions));
     return(this);
 }