public void GetWidgetsList_WhenSuccessful_ReturnAList() { //Arrange Mock <IWidgetRepository> mockWidgetRepository = new Mock <IWidgetRepository>(); mockWidgetRepository.Setup(m => m.AllWidgets()).Returns(_widgetsList); Widgets widgetServicio = new Widgets(mockWidgetRepository.Object); //Act List <P2PWidget> widgets = widgetServicio.AllWidgets(); //Assert Assert.AreEqual(_widgetsList, widgets); }