示例#1
0
        public async Task <IActionResult> Create([FromBody] ExampleModel data)
        {
            var service = new ExampleService(connString);
            var result  = await service.Create(data);

            return(httpResult.Message(result.Code, result));
        }
示例#2
0
        public void CreateExample_ShouldReturn_NumberOfEntitiesCreated()
        {
            var entry = new List <ExampleEntity>
            {
                new ExampleEntity
                {
                    Name        = "Mock Name",
                    Description = "Mock Description"
                }
            };
            var result = service.Create(entry);

            Assert.Multiple(() =>
            {
                repository.Verify(r => r.Create(It.IsAny <List <ExampleModel> >()), Times.Once);
                Assert.NotZero(result);
            });
        }