public void Multiply_AxBsquared_EqualsAxAxBxB() { // Arrange IDimension a = CreateStubDimension("a"); IDimension b = CreateStubDimension("b"); CompoundDimension unit = new CompoundDimension(a); CompoundDimension axb = (CompoundDimension)unit.Multiply(b); // Act IDimension axbsquared = axb.Multiply(axb); IDimension axaxbxb = unit.Multiply(a, b, b); // Assert Assert.AreEqual(axaxbxb, axbsquared); }
public void Multiply_AxB_ReturnsCompoundUnit() { // Arrange IDimension a = CreateStubDimension("a"); IDimension b = CreateStubDimension("b"); CompoundDimension unit = new CompoundDimension(a); // Act IDimension result = unit.Multiply(b); // Assert Assert.IsInstanceOf(typeof(CompoundDimension), result); }
public void Multiply_AoverBx1_ReturnsSelf() { // Arrange IDimension a = CreateStubDimension("a"); IDimension b = CreateStubDimension("b"); CompoundDimension dimension = new CompoundDimension(a, b); // Act IDimension result = dimension.Multiply(Dimsensionless.Instance); // Assert Assert.AreSame(dimension, result); }
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); }
/// <summary> /// Multiply the current dimension with the dimension(s) given. /// </summary> /// <param name="dimensions">One or more dimensions.</param> public DimensionCreator Multiply(params IDimension[] dimensions) { UpdateDimension(_dimension.Multiply(dimensions)); return(this); }