Inverted some control, added moq, edited some unit tests