示例#1
0
        public void GetControllerFileText_passed_normal_entity_creates_expected_text_without_swagger()
        {
            var classNamespace = "WebApi.Controllers.v1";
            var entity         = CannedGenerator.FakeBasicProduct();

            var fileText = ControllerBuilder.GetControllerFileText(classNamespace, entity, false, new List <Policy>(), "", "");

            var expectedText = @$ "namespace WebApi.Controllers.v1
{{
    using System;
    using System.Collections.Generic;
    using System.Text.Json;
    using Microsoft.AspNetCore.JsonPatch;
    using Microsoft.AspNetCore.Mvc;
    using Microsoft.AspNetCore.Authorization;
    using System.Threading.Tasks;
    using .Core.Dtos.Product;
    using .Core.Wrappers;
    using System.Threading;
    using MediatR;
    using static .WebApi.Features.Products.GetProductList;
        public void GetControllerFileText_passed_normal_entity_creates_expected_text()
        {
            var classNamespace = "WebApi.Controllers.v1";
            var entity         = CannedGenerator.FakeBasicProduct();

            var fileText = ControllerBuilder.GetControllerFileText(classNamespace, entity);

            var expectedText = @$ "namespace WebApi.Controllers.v1
{{
    using System;
    using System.Collections.Generic;
    using System.Text.Json;
    using AutoMapper;
    using FluentValidation.AspNetCore;
    using Application.Dtos.Product;
    using Application.Enums;
    using Application.Interfaces.Product;
    using Application.Validation.Product;
    using Domain.Entities;
    using Microsoft.AspNetCore.JsonPatch;
    using Microsoft.AspNetCore.Mvc;
    using Microsoft.AspNetCore.Authorization;
    using System.Threading.Tasks;