public void WidgetService_GetWidget_ReturnsAWidgetWhenIdExists() { var textWidget = new BasicMappedWidget(); Session.Transact(session => session.SaveOrUpdate(textWidget)); var loadedWidget = _widgetService.GetWidget <BasicMappedWidget>(textWidget.Id); loadedWidget.Should().BeSameAs(textWidget); }
public void ConnectToExpensiveResourceAndGetAWidget() { var service = new WidgetService(new WidgetData()); var widget = service.GetWidget(1); //gotta make sure my data has this widget! Assert.IsNotNull(widget); }
public void GetWidgetExpected() { var mockData = GetStubData(); var service = new WidgetService(mockData.Object); var widget = service.GetWidget(1); Assert.IsNotNull(widget); }
public void WidgetNullIfNotFound() { //arrange var mockData = GetStubData(); var service = new WidgetService(mockData.Object); //act var widget = service.GetWidget(5); //assert Assert.IsNull(widget); }