public void AddItemToRepository() { var id = Guid.NewGuid(); using (var domain = new SqlRepositoryDomain()) { Feature.WithScenario("Add a new item to the database") .Given(domain.TheWolfpackDatabaseIsClearedOfNotifications) .When(domain.NotificationWithId_IsAddedToTheRepository, id) .Then(domain.TheNotificationWithId_ShouldBeInTheNotificationTable, id) .ExecuteWithReport(); } }
public void ChainedQuery() { var id = Guid.NewGuid(); using (var domain = new SqlRepositoryDomain()) { Feature.WithScenario("chaining multiple queries together") .Given(domain.TheWolfpackDatabaseIsClearedOfNotifications) .And(domain.NotificationWithId_IsAddedToTheRepository, id) .When(domain.TheQueryForId_AndState_IsExecuted, id, MessageStateTypes.NotSet) .Then(domain.TheQueryResultsShouldHave_Items, 1) .ExecuteWithReport(); } }