public void ThrowArgumentNullException_WhenIDishesAsyncServiceIsNull() { var topDishesView = new Mock <ITopDishesView>(); IDishesAsyncService dishesService = null; Assert.That( () => new TopDishesPresenter(topDishesView.Object, dishesService), Throws.InstanceOf <ArgumentNullException>().With.Message.Contains(nameof(dishesService))); }
public CreatePresenter(ICreateView view, IDishesAsyncService dishesAsyncService) : base(view) { Guard.WhenArgument(dishesAsyncService, nameof(IDishesAsyncService)).IsNull().Throw(); this.dishesAsyncService = dishesAsyncService; this.View.CreateDish += this.OnCreateDish; }
public DetailsPresenter(IDetailsView view, IDishesAsyncService dishesAsyncService) : base(view) { Guard.WhenArgument(dishesAsyncService, nameof(IDishesAsyncService)).IsNull().Throw(); this.dishesAsyncService = dishesAsyncService; base.View.OnGetDishDetails += this.OnGetDishDetails; base.View.OnLikeVote += this.OnLikeVote; base.View.OnDislikeVote += this.OnDislikeVote; }
public TopDishesPresenter(ITopDishesView view, IDishesAsyncService dishesService) : base(view) { if (dishesService == null) { throw new ArgumentNullException(nameof(dishesService)); } this.dishesService = dishesService; this.View.GetTopDishes += this.OnGetTopDishes; }