コード例 #1
0
        public async Task AcceptMarriageTestAsync()
        {
            await InitMarriageAsync();

            await using var context = NewContext();
            var service  = new MarriageService(context);
            var marriage = await service.GetMarriageAsync(1L, 2L);

            Assert.False(marriage.Marriage.IsProposing);
            Assert.NotEqual(marriage.Marriage.TimeOfProposal, marriage.Marriage.TimeOfMarriage);
        }
コード例 #2
0
        public async Task DeclineProposalTestAsync()
        {
            await InitMarriageAsync();

            await using (var context = NewContext())
            {
                var service  = new MarriageService(context);
                var marriage = await service.GetMarriageAsync(1L, 2L);

                await service.DeclineProposalAsync(marriage);
            }

            await using (var context = NewContext())
            {
                var service  = new MarriageService(context);
                var proposal = await service.GetEntryAsync(1L, 2L);

                Assert.Null(proposal);
            }
        }