func TestExtractMass_Good(t *testing.T) { m := mat1() cmp := m.Comp var qty float64 = 4.9 e, err := m.ExtractMass(qty) assert.NoErr(t, err).Fatal() assert.Eq(t, m.Qty(), qty1-qty) assert.Eq(t, e.Qty(), qty) assert.Eq(t, m.Comp, cmp) assert.Eq(t, e.Comp, cmp) }
func TestExtractComp_Good(t *testing.T) { m := mat1() mcmp := m.Comp ecmp := mat2().Comp var qty float64 = 1.0 e, err := m.ExtractComp(qty, ecmp) assert.NoErr(t, err).Fatal() assert.Eq(t, m.Qty(), qty1-qty) assert.Eq(t, e.Qty(), qty) assert.Ne(t, m.Comp, mcmp) assert.Eq(t, e.Comp, ecmp) }