コード例 #1
0
        public async void Add_ShouldCreateMerchant_WhenAllIsWell()
        {
            //Arrange
            var merchant = new Merchant {
                Name = "TestMerchant"
            };

            //Act
            var createdMerchant = await _merchantBc.Add(merchant);

            //Assert
            Assert.NotNull(createdMerchant);
            Assert.Equal(merchant.Name, createdMerchant.Name);
            Assert.NotEqual(default, createdMerchant.Id);
コード例 #2
0
        public async Task <IActionResult> Create(CreateMerchantDto merchant)
        {
            var createdMerchant = await _merchantBc.Add(new Merchant { Name = merchant.Name });

            return(Ok(MerchantMappers.Map(createdMerchant)));
        }