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); }
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); }
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> /// 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); }