示例#1
0
        public async Task AsyncEntityWriter_AddAsync()
        {
            var customer  = MemorySeeder.SeedCustomer();
            var successed = await _writer.AddAsync(customer);

            Assert.IsTrue(successed);
            Assert.IsTrue(customer.Id.IsNotZeroOrEmpty());

            var result = await _reader.FirstOrDefaultAsync(customer.Id);

            Assert.IsNotNull(result);
            Assert.IsInstanceOf(typeof(Customer), result);
        }
示例#2
0
        public void EntityWriter_Add()
        {
            var customer  = MemorySeeder.SeedCustomer();
            var successed = _writer.Add(customer);

            Assert.IsTrue(successed);
            Assert.IsTrue(customer.Id.IsNotZeroOrEmpty());

            var result = _reader.FirstOrDefault(customer.Id);

            Assert.IsNotNull(result);
            Assert.IsInstanceOf(typeof(Customer), result);
        }