Exemplo n.º 1
0
        public void DatabaseIsPassedToDelegate_When_Invoked()
        {
            IDatabase <int, int> passedDb = default;

            using var wQuery = new WriteQuery <int, int>(db => passedDb = db);
            wQuery.Execute(_db);

            passedDb.Should()
            .BeEquivalentTo(_db);
        }
Exemplo n.º 2
0
        public void Executes_DelegateInConstructor_When_Invoked()
        {
            var invoked = false;

            using var wQuery = new WriteQuery <int, int>(_ => invoked = true);
            wQuery.Execute(_db);

            invoked.Should()
            .BeTrue();
        }