예제 #1
0
        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();
            }
        }
예제 #2
0
        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();
            }
        }
예제 #3
0
        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();
            }
        }
예제 #4
0
        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();
            }
        }