public void SetLocator() { ServiceLocator.SetLocator(type => { if (type == typeof(Mock)) { return(new Mock()); } else { return(ServiceLocator.DefaultLocator(type)); } }); }