Exemplo n.º 1
0
        public async Task GetAllTestAsync()
        {
            // given
            var mock = new GameServiceMock();
            await mock.SaveAsync(new GameDto());

            GameFunction.ResolveService = table => mock;

            // when
            var entities = await GameFunction.GetAllAsync(null, null, null);

            // then
            Assert.Single(entities);
        }
Exemplo n.º 2
0
        public async Task SaveTestAsync()
        {
            // given
            var mock = new GameServiceMock();

            GameFunction.ResolveService = table => mock;

            // when 1
            var entities = await GameFunction.GetAllAsync(null, null, null);

            // then 1
            Assert.Empty(entities);

            // when 2
            var entity = await GameFunction.SaveAsync(new GameDto(), null, null);

            entities = await GameFunction.GetAllAsync(null, null, null);

            // then 2
            Assert.False(string.IsNullOrWhiteSpace(entity.Id));
            Assert.Single(entities);
        }