|
@@ -1,22 +1,16 @@
|
|
-using DocumentFormat.OpenXml.Wordprocessing;
|
|
|
|
-using Hotline.Api.Controllers;
|
|
|
|
|
|
+using Hotline.Api.Controllers;
|
|
|
|
+using AutoFixture;
|
|
using Hotline.Application.Snapshot;
|
|
using Hotline.Application.Snapshot;
|
|
using Hotline.Identity.Accounts;
|
|
using Hotline.Identity.Accounts;
|
|
using Hotline.Identity.Roles;
|
|
using Hotline.Identity.Roles;
|
|
using Hotline.Share.Dtos.Snapshot;
|
|
using Hotline.Share.Dtos.Snapshot;
|
|
using Hotline.Share.Tools;
|
|
using Hotline.Share.Tools;
|
|
-using Hotline.Snapshot;
|
|
|
|
using Hotline.Snapshot.Interfaces;
|
|
using Hotline.Snapshot.Interfaces;
|
|
using Hotline.Users;
|
|
using Hotline.Users;
|
|
using Mapster;
|
|
using Mapster;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Shouldly;
|
|
using Shouldly;
|
|
-using System;
|
|
|
|
-using System.Collections.Generic;
|
|
|
|
-using System.Linq;
|
|
|
|
-using System.Text;
|
|
|
|
-using System.Threading.Tasks;
|
|
|
|
using XF.Domain.Repository;
|
|
using XF.Domain.Repository;
|
|
|
|
|
|
namespace Hotline.Application.Tests.Application;
|
|
namespace Hotline.Application.Tests.Application;
|
|
@@ -82,4 +76,25 @@ public class IndustryApplicationTest : TestBase
|
|
caseEntityUpdate.DisplayOrder.ShouldBe(updateDto.DisplayOrder);
|
|
caseEntityUpdate.DisplayOrder.ShouldBe(updateDto.DisplayOrder);
|
|
caseEntityUpdate.Name.ShouldBe(updateDto.Name);
|
|
caseEntityUpdate.Name.ShouldBe(updateDto.Name);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 新增行业短信模板
|
|
|
|
+ /// 行业短信模板集合
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [Fact]
|
|
|
|
+ public async Task SMSTemplate_Test()
|
|
|
|
+ {
|
|
|
|
+ var industryItems = await _industryApplication.GetIndustres(new IndustryListInDto(null, null)).ToListAsync();
|
|
|
|
+ var industry = industryItems.First();
|
|
|
|
+ var inDto = _fixture.Create<AddSnapshotSMSTemplateInDto>();
|
|
|
|
+ inDto.IndustryId = industry.Id;
|
|
|
|
+ var smsId = await _industryApplication.AddSMSTemplateAsync(inDto);
|
|
|
|
+ var items = await _industryApplication.GetSMSTemplates(new SnapshotSMSTemplateItemsInDto(null)).ToListAsync();
|
|
|
|
+ items.Count.ShouldNotBe(0);
|
|
|
|
+ var sms = items.Where(m => m.Id == smsId).First();
|
|
|
|
+ sms.Content.ShouldBe(inDto.Content);
|
|
|
|
+ sms.IndustryName.ShouldNotBeNullOrEmpty();
|
|
|
|
+ sms.IsEnable.ShouldBe(inDto.IsEnable);
|
|
|
|
+ }
|
|
}
|
|
}
|