tests added and inject method written