懒得勤快 5 years ago
parent
commit
8510e9c28e

+ 0 - 35
Masuit.Tools.Test/ChineseCalendarTest.cs

@@ -1,35 +0,0 @@
-using Masuit.Tools.DateTimeExt;
-using System;
-using Xunit;
-
-namespace Masuit.Tools.Test
-{
-    public class ChineseCalendarTest
-    {
-        [Fact]
-        public void GetChineseDateString_ReturnChineseDateString()
-        {
-            var cc = new ChineseCalendar(DateTime.Parse("2018-11-27"));
-            string actual = cc.ChineseDateString;
-            Assert.Equal("二零一八年十月二十", actual);
-        }
-
-        [Theory, InlineData("2018-11-27"), InlineData("2019-02-02")]
-        public void JudgeWorkDay_ReturnTrue(string date)
-        {
-            ChineseCalendar.CustomWorkDays.Add(DateTime.Parse("2019-02-02"));
-            var cc = new ChineseCalendar(DateTime.Parse(date));
-            var actual = cc.IsWorkDay;
-            Assert.True(actual);
-        }
-
-        [Fact]
-        public void JudgeHoliday_ReturnTrue()
-        {
-            ChineseCalendar.CustomHolidays.Add(DateTime.Parse("2019-2-6"), "春节");
-            var cc = new ChineseCalendar(DateTime.Parse("2019-2-6"));
-            var actual = cc.IsHoliday;
-            Assert.True(actual);
-        }
-    }
-}

+ 0 - 41
Masuit.Tools.Test/CompressTest.cs

@@ -1,41 +0,0 @@
-using Masuit.Tools.Files;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using Xunit;
-
-namespace Masuit.Tools.Test
-{
-    public class CompressTest
-    {
-        [Fact]
-        public void Can_CompressFiles_ReturnStream()
-        {
-            var ms = SevenZipCompressor.ZipStream(new List<string>()
-            {
-                //AppContext.BaseDirectory,
-                "http://ww3.sinaimg.cn/large/87c01ec7gy1fsq6rywto2j20je0d3td0.jpg",
-                "http://192.168.16.150:3000string",
-            });
-            Assert.True(ms.Length > 0);
-        }
-
-        [Fact]
-        public void Can_CompressToFile()
-        {
-            string zip = Path.Combine(Environment.GetEnvironmentVariable("temp"), Stopwatch.GetTimestamp() + ".rar");
-            SevenZipCompressor.Zip(new List<string>()
-            {
-                AppContext.BaseDirectory,
-                "http://ww3.sinaimg.cn/large/87c01ec7gy1fsq6rywto2j20je0d3td0.jpg",
-                "http://192.168.16.150:3000string",
-            }, zip);
-            using (FileStream stream = File.OpenRead(zip))
-            {
-                Assert.True(stream.Length > 0);
-            }
-        }
-
-    }
-}

+ 0 - 38
Masuit.Tools.Test/ExtensionMethodsTest.cs

@@ -1,38 +0,0 @@
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Xunit;
-using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert;
-
-namespace Masuit.Tools.Test
-{
-    [TestClass]
-    public class ExtensionMethodsTest
-    {
-        [TestMethod]
-        public void MatchUrl_True()
-        {
-            bool expect = "https://git.lug.us-tc.edu.cn/masuit/soft".MatchUrl();
-            Assert.AreEqual(true, expect);
-        }
-
-        [TestMethod]
-        public void MatchEmail()
-        {
-            var (expect, match) = "[email protected]".MatchEmail();
-            Assert.AreEqual(true, expect);
-        }
-        [TestMethod]
-        public void MatchIdentifyCard_False()
-        {
-            bool expect = "513901199509120610".MatchIdentifyCard();
-            Assert.AreEqual(false, expect);
-        }
-
-        [Theory]
-        [InlineData("16666666666")]
-        [InlineData("19999999999")]
-        public void Can_MatchPhoneNumber_(string phone)
-        {
-            Xunit.Assert.True(phone.MatchPhoneNumber());
-        }
-    }
-}

+ 0 - 25
Masuit.Tools.Test/HtmlToolsTest.cs

@@ -1,25 +0,0 @@
-using Masuit.Tools.Html;
-using Xunit;
-
-namespace Masuit.Tools.Test
-{
-    public class HtmlToolsTest
-    {
-        [Theory]
-        [InlineData("<p><img src=\"https://ww1.sinaimg.cn/large/007iUjdily1fxefem7juyj30ld037q35\"/></p><p><img src=\"https://ww1.sinaimg.cn/large/007iUjdily1fxeffei83dj30l90nbgr8\"/></p><p><img src=\"https://ww1.sinaimg.cn/large/007iUjdily1fxeffz9u1kj30lc0n90y1\"/></p><p><img src=\"https://ww1.sinaimg.cn/large/007iUjdily1fxefgh6xxoj30lc09aq4q\"/></p>")]
-        [InlineData("<p><img title=\"title\" src=\"https://ww1.sinaimg.cn/large/007iUjdily1fxefem7juyj30ld037q35\"/></p><p><img title=\"title\" src=\"https://ww1.sinaimg.cn/large/007iUjdily1fxeffei83dj30l90nbgr8\"/></p><p><img src=\"https://ww1.sinaimg.cn/large/007iUjdily1fxeffz9u1kj30lc0n90y1\"/></p><p><img title=\"title\" src=\"https://ww1.sinaimg.cn/large/007iUjdily1fxefgh6xxoj30lc09aq4q\"/></p>")]
-        public void MatchRandomImgSrc_NormalHtml_ReturnAImgUrl(string html)
-        {
-            string src = html.MatchRandomImgSrc();
-            Assert.True(src.StartsWith("http"));
-        }
-
-        [Fact]
-        public void MatchRandomImgSrc_NoImgHtml_ReturnNull()
-        {
-            string html = "<p>如果你是通过某宝、或是其他论坛等渠道,通过任何付费的方式获取到本资源,请直接退款并在相应的平台举报,如果是论坛的,请将本页链接分享到你购买源的评论区,告诫他人谨防上当,或者直接将本页链接转发分享给有需要的人,感谢您的支持和监督。</p>";
-            string src = html.MatchRandomImgSrc();
-            Assert.True(string.IsNullOrEmpty(src));
-        }
-    }
-}

+ 0 - 36
Masuit.Tools.Test/LinqExtensionTest.cs

@@ -1,36 +0,0 @@
-using Masuit.Tools.Linq;
-using System;
-using System.Linq.Expressions;
-using Xunit;
-
-namespace Masuit.Tools.Test
-{
-    public class LinqExtensionTest
-    {
-        [Fact]
-        public void And_TwoBoolExpression()
-        {
-            //arrange
-            Expression<Func<string, bool>> where1 = s => s.StartsWith("a");
-            Expression<Func<string, bool>> where2 = s => s.Length > 10;
-            Func<string, bool> func = where1.And(where2).Compile();
-
-            //act assert
-            Assert.False(func("abc"));
-            Assert.True(func("abcd12345678"));
-        }
-        [Fact]
-        public void Or_TwoBoolExpression()
-        {
-            //arrange
-            Expression<Func<string, bool>> where1 = s => s.StartsWith("a");
-            Expression<Func<string, bool>> where2 = s => s.Length > 10;
-            Func<string, bool> func = where1.Or(where2).Compile();
-
-            //act assert
-            Assert.True(func("abc"));
-            Assert.True(func("abcd12345678"));
-            Assert.False(func("cbcd12348"));
-        }
-    }
-}

+ 0 - 161
Masuit.Tools.Test/Masuit.Tools.Test.csproj

@@ -1,161 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props')" />
-  <Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" />
-  <Import Project="..\packages\xunit.core.2.4.1\build\xunit.core.props" Condition="Exists('..\packages\xunit.core.2.4.1\build\xunit.core.props')" />
-  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{AB9F4635-0ACB-4E5E-8E1B-431E0818CF60}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>Masuit.Tools.Test</RootNamespace>
-    <AssemblyName>Masuit.Tools.Test</AssemblyName>
-    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
-    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
-    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
-    <IsCodedUITest>False</IsCodedUITest>
-    <TestProjectType>UnitTest</TestProjectType>
-    <NuGetPackageImportStamp>
-    </NuGetPackageImportStamp>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
-      <HintPath>..\packages\Castle.Core.4.4.1\lib\net45\Castle.Core.dll</HintPath>
-    </Reference>
-    <Reference Include="Microsoft.CSharp" />
-    <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\packages\MSTest.TestFramework.2.1.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
-    </Reference>
-    <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\packages\MSTest.TestFramework.2.1.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
-    </Reference>
-    <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
-    </Reference>
-    <Reference Include="Moq, Version=4.14.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
-      <HintPath>..\packages\Moq.4.14.5\lib\net45\Moq.dll</HintPath>
-    </Reference>
-    <Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
-      <HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
-    </Reference>
-    <Reference Include="System" />
-    <Reference Include="System.Configuration" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Numerics" />
-    <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.7.1\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
-    </Reference>
-    <Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Web" />
-    <Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
-    </Reference>
-    <Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
-      <HintPath>..\packages\xunit.abstractions.2.0.3\lib\net35\xunit.abstractions.dll</HintPath>
-    </Reference>
-    <Reference Include="xunit.assert, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
-      <HintPath>..\packages\xunit.assert.2.4.1\lib\netstandard1.1\xunit.assert.dll</HintPath>
-    </Reference>
-    <Reference Include="xunit.core, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
-      <HintPath>..\packages\xunit.extensibility.core.2.4.1\lib\net452\xunit.core.dll</HintPath>
-    </Reference>
-    <Reference Include="xunit.execution.desktop, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
-      <HintPath>..\packages\xunit.extensibility.execution.2.4.1\lib\net452\xunit.execution.desktop.dll</HintPath>
-    </Reference>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="ChineseCalendarTest.cs" />
-    <Compile Include="CompressTest.cs" />
-    <Compile Include="ExtensionMethodsTest.cs" />
-    <Compile Include="HtmlToolsTest.cs" />
-    <Compile Include="LinqExtensionTest.cs" />
-    <Compile Include="Mvc\BaseTests.cs" />
-    <Compile Include="Mvc\MimeMapperTests.cs" />
-    <Compile Include="Mvc\Mocks\MockHttpFilesCollection.cs" />
-    <Compile Include="Mvc\Mocks\MockHttpPostedFileBase.cs" />
-    <Compile Include="Mvc\Mocks\MockHttpRequest.cs" />
-    <Compile Include="Mvc\Mocks\MockHttpResponse.cs" />
-    <Compile Include="Mvc\Mocks\MockHttpSession.cs" />
-    <Compile Include="Mvc\Mocks\MockRequestContext.cs" />
-    <Compile Include="Mvc\Mocks\MockResumeFileResult.cs" />
-    <Compile Include="Mvc\ResumeFileResultTests.cs" />
-    <Compile Include="NumberFormaterTest.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="Reflection\ClassHelperTest.cs" />
-    <Compile Include="RSATest.cs" />
-    <Compile Include="TemplateTest.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="app.config" />
-    <None Include="packages.config" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\Masuit.Tools.Abstractions\Masuit.Tools.Abstractions.csproj">
-      <Project>{74e7c0a2-499d-408f-a2e4-08878700c2de}</Project>
-      <Name>Masuit.Tools.Abstractions</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\Masuit.Tools\Masuit.Tools.csproj">
-      <Project>{275d5a0d-c49c-497e-a4b5-f40285c2495f}</Project>
-      <Name>Masuit.Tools</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <Analyzer Include="..\packages\xunit.analyzers.0.10.0\analyzers\dotnet\cs\xunit.analyzers.dll" />
-  </ItemGroup>
-  <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
-    <PropertyGroup>
-      <ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
-    </PropertyGroup>
-    <Error Condition="!Exists('..\packages\xunit.core.2.4.1\build\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.4.1\build\xunit.core.props'))" />
-    <Error Condition="!Exists('..\packages\xunit.core.2.4.1\build\xunit.core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.4.1\build\xunit.core.targets'))" />
-    <Error Condition="!Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.12.0\build\NUnit.props'))" />
-    <Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props'))" />
-    <Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets'))" />
-  </Target>
-  <Import Project="..\packages\xunit.core.2.4.1\build\xunit.core.targets" Condition="Exists('..\packages\xunit.core.2.4.1\build\xunit.core.targets')" />
-  <Import Project="..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets')" />
-</Project>

+ 0 - 84
Masuit.Tools.Test/Mvc/BaseTests.cs

@@ -1,84 +0,0 @@
-using Masuit.Tools.Test.Mvc.Mocks;
-using Moq;
-using NUnit.Framework;
-using System;
-using System.IO;
-using System.Web;
-using System.Web.Mvc;
-using System.Web.Routing;
-
-namespace Masuit.Tools.Test.Mvc
-{
-    [TestFixture]
-    public abstract class BaseTests
-    {
-        protected internal MockHttpResponse Response { get; set; }
-        protected internal HttpContextBase Context { get; set; }
-        protected internal MockHttpRequest Request { get; set; }
-        protected internal MockHttpSession Session { get; private set; }
-
-        protected string TestDirectoryPath()
-        {
-            return new DirectoryInfo(AppContext.BaseDirectory + ".\\Resources").FullName;
-        }
-
-        protected FileInfo TestFile(string fileName)
-        {
-            return new FileInfo($"{TestDirectoryPath()}\\{fileName}");
-        }
-
-        protected string FilePath(string fileName)
-        {
-            return TestFile(fileName).FullName;
-        }
-
-        protected BaseTests()
-        {
-            InitMocks();
-        }
-
-        [SetUp]
-        public void BaseTestsSetup()
-        {
-            InitMocks();
-        }
-
-        protected void InitMocks()
-        {
-            var mockHttpContext = new Mock<HttpContextBase>();
-            Context = mockHttpContext.Object;
-            Session = new MockHttpSession();
-            Request = new MockHttpRequest(new MockHttpFilesCollection(null));
-            Response = new MockHttpResponse();
-
-            mockHttpContext.Setup(ctx => ctx.Session).Returns(() => Session);
-            mockHttpContext.Setup(ctx => ctx.Request).Returns(() => Request);
-            mockHttpContext.Setup(ctx => ctx.Response).Returns(() => Response);
-            mockHttpContext.Setup(ctx => ctx.Cache).Returns(() => HttpRuntime.Cache);
-        }
-
-        protected ControllerContext ControllerContext<T>(T controller) where T : ControllerBase
-        {
-            return new ControllerContext(Context, new RouteData(), controller);
-        }
-
-        protected ModelBindingContext BindingContext<T>()
-        {
-            return new ModelBindingContext
-            {
-                ModelMetadata = ModelMetadataProviders.Current.GetMetadataForType(null, typeof(T))
-            };
-        }
-
-        protected T MockObject<T>() where T : class
-        {
-            var mock = new Mock<T>();
-            return mock.Object;
-        }
-
-        protected Mock<T> Mock<T>() where T : class
-        {
-            return new Mock<T>();
-        }
-    }
-}

+ 0 - 82
Masuit.Tools.Test/Mvc/MimeMapperTests.cs

@@ -1,82 +0,0 @@
-// ReSharper disable InconsistentNaming
-
-using Masuit.Tools.Mvc.Mime;
-using NUnit.Framework;
-
-namespace Masuit.Tools.UnitTest.Mvc
-{
-    [TestFixture]
-    public class MimeMapperTests
-    {
-        private IMimeMapper _mapper;
-
-        [SetUp]
-        public void Setup()
-        {
-            _mapper = new MimeMapper();
-        }
-
-        [Test]
-        public void GetDefaultExtension()
-        {
-            Assert.AreEqual("text/plain", _mapper.GetMimeFromExtension("txt"));
-        }
-
-        [Test]
-        public void Search_Works_For_Extensions_With_Dot_As_Well()
-        {
-            Assert.IsNotNull(_mapper.GetMimeFromExtension("css"));
-            Assert.AreEqual(_mapper.GetMimeFromExtension("css"), _mapper.GetMimeFromExtension(".css"));
-        }
-
-        [Test]
-        public void It_Returns_Default_Mime_For_Null_In_Extension()
-        {
-            Assert.AreEqual("application/octet-stream", _mapper.GetMimeFromExtension(null));
-        }
-
-        [Test]
-        public void It_Returns_Default_Mime_For_Not_Found_Extension()
-        {
-            Assert.AreEqual("application/octet-stream", _mapper.GetMimeFromExtension("not found"));
-        }
-
-        [Test]
-        public void It_Searches_In_Full_Path()
-        {
-            Assert.AreEqual("image/gif", _mapper.GetMimeFromPath("C:\\folder1\\folder2\\text.gif"));
-        }
-
-        [Test]
-        public void It_Searches_In_Relative_Path()
-        {
-            Assert.AreEqual("image/gif", _mapper.GetMimeFromPath("..\\..\\..\\text.gif"));
-        }
-
-        [Test]
-        public void Extension_Overrides_Default_Mime()
-        {
-            _mapper = new MimeMapper(new MimeMappingItem
-            {
-                Extension = "txt",
-                MimeType = "my own mime type"
-            });
-            Assert.AreEqual("my own mime type", _mapper.GetMimeFromPath(".txt"));
-            Assert.AreEqual("my own mime type", _mapper.GetMimeFromPath("..\\..\\..\\text.txt"));
-        }
-
-        [Test]
-        public void Search_Works_For_Files_With_Dots_In_Name()
-        {
-            Assert.AreEqual("text/javascript", _mapper.GetMimeFromPath("jquery.min.js"));
-            Assert.AreEqual("text/javascript", _mapper.GetMimeFromPath("http://example.com/jquery.min.js"));
-        }
-
-        [Test]
-        public void It_Returns_Default_Mime_For_Files_Without_Extension()
-        {
-            Assert.AreEqual("application/octet-stream", _mapper.GetMimeFromPath("testfile"));
-            Assert.AreEqual("application/octet-stream", _mapper.GetMimeFromPath("\\\\network\\share\\testfile"));
-        }
-    }
-}

+ 0 - 35
Masuit.Tools.Test/Mvc/Mocks/MockHttpFilesCollection.cs

@@ -1,35 +0,0 @@
-using Mvc.Stream.Tests.Mocks;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-
-namespace Masuit.Tools.Test.Mvc.Mocks
-{
-    public class MockHttpFilesCollection : HttpFileCollectionBase
-    {
-        private readonly Dictionary<string, MockHttpPostedFileBase> _files
-            = new Dictionary<string, MockHttpPostedFileBase>();
-
-        public MockHttpFilesCollection(MockHttpPostedFileBase file)
-        {
-            if (file != null)
-            {
-                _files.Add(file.FileName, file);
-            }
-        }
-
-        public override int Count => _files.Count;
-
-        public override HttpPostedFileBase this[int index] => _files.Skip(index).Take(1).FirstOrDefault().Value;
-
-        public override HttpPostedFileBase this[string name] => _files[name];
-
-        public override string[] AllKeys
-        {
-            get
-            {
-                return _files.Select(x => x.Key).ToArray();
-            }
-        }
-    }
-}

+ 0 - 40
Masuit.Tools.Test/Mvc/Mocks/MockHttpPostedFileBase.cs

@@ -1,40 +0,0 @@
-using System.IO;
-using System.Web;
-
-namespace Mvc.Stream.Tests.Mocks
-{
-    public class MockHttpPostedFileBase : HttpPostedFileBase
-    {
-        public MockHttpPostedFileBase(int contentLen, string fileName, string contentType, System.IO.Stream stream = null)
-        {
-            ContentLength = contentLen;
-            FileName = fileName;
-            ContentType = contentType;
-            InputStream = stream;
-        }
-
-        public override int ContentLength { get; }
-
-        public override string FileName { get; }
-
-        public override System.IO.Stream InputStream { get; }
-
-        public override string ContentType { get; }
-
-        public override void SaveAs(string filename)
-        {
-            var fileInfo = new FileInfo(filename);
-            var directory = new DirectoryInfo(Path.GetDirectoryName(fileInfo.FullName));
-
-            if (!directory.Exists)
-            {
-                directory.Create();
-            }
-
-            using (var file = fileInfo.CreateText())
-            {
-                file.Write("test");
-            }
-        }
-    }
-}

+ 0 - 61
Masuit.Tools.Test/Mvc/Mocks/MockHttpRequest.cs

@@ -1,61 +0,0 @@
-using System;
-using System.Collections.Specialized;
-using System.IO;
-using System.Web;
-using System.Web.Routing;
-
-namespace Masuit.Tools.Test.Mvc.Mocks
-{
-    public class MockHttpRequest : HttpRequestBase
-    {
-        public override NameValueCollection Headers => _headers;
-
-        public override HttpFileCollectionBase Files { get; }
-
-        public override RequestContext RequestContext => _context;
-        public override string ApplicationPath => _applicationPath;
-
-        public override System.IO.Stream InputStream
-        {
-            get
-            {
-                if (TestInput != null)
-                {
-                    var stream = new MemoryStream();
-                    var chars = TestInput.ToCharArray();
-                    foreach (var c in chars)
-                    {
-                        stream.WriteByte(Convert.ToByte(c));
-                    }
-                    return stream;
-                }
-                return new MemoryStream();
-            }
-        }
-
-        public override string HttpMethod => TestHttpMethod;
-        private readonly NameValueCollection _headers = new NameValueCollection();
-        private readonly MockRequestContext _context = new MockRequestContext();
-        private string _applicationPath;
-        public string TestInput;
-
-        public string TestHttpMethod;
-
-        public MockHttpRequest(MockHttpFilesCollection filesMock)
-        {
-            Files = filesMock;
-        }
-
-        public MockHttpRequest SetHeader(string header, string val)
-        {
-            _headers[header] = val;
-            return this;
-        }
-
-        public MockHttpRequest SetApplicationPath(string path)
-        {
-            _applicationPath = path;
-            return this;
-        }
-    }
-}

+ 0 - 84
Masuit.Tools.Test/Mvc/Mocks/MockHttpResponse.cs

@@ -1,84 +0,0 @@
-using System.Collections.Specialized;
-using System.IO;
-using System.Web;
-
-namespace Masuit.Tools.Test.Mvc.Mocks
-{
-    public class MockHttpResponse : HttpResponseBase
-    {
-        public override NameValueCollection Headers => _headers;
-
-        public bool FileTransmitted { get; set; }
-        public override bool BufferOutput { get; set; }
-
-        public override System.IO.Stream OutputStream => _stream ?? (_stream = new MemoryStream());
-
-        public override bool IsClientConnected => true;
-
-        public override string ContentType { get; set; }
-
-        public override int StatusCode { get; set; }
-
-        private readonly NameValueCollection _headers = new NameValueCollection();
-
-        private MemoryStream _stream;
-
-        public bool IsClosed;
-
-        public override void AppendHeader(string name, string value)
-        {
-            AddHeader(name, value);
-        }
-
-        public override void AddHeader(string name, string value)
-        {
-            _headers.Add(name, value);
-        }
-
-        public void ClearTestResponse()
-        {
-            _stream = new MemoryStream();
-            Headers.Clear();
-            StatusCode = 0;
-        }
-
-        public override void Flush()
-        {
-        }
-
-        public override void Write(string s)
-        {
-        }
-
-        public override void Close()
-        {
-            IsClosed = true;
-        }
-
-        public override void TransmitFile(string filename)
-        {
-            FileTransmitted = true;
-            var fi = new FileInfo(filename);
-            using (var read = fi.OpenRead())
-            {
-                for (var i = 0; i < fi.Length; i++)
-                {
-                    OutputStream.WriteByte((byte)read.ReadByte());
-                }
-            }
-        }
-
-        public override void TransmitFile(string filename, long offset, long length)
-        {
-            var fi = new FileInfo(filename);
-            using (var read = fi.OpenRead())
-            {
-                read.Seek(offset, SeekOrigin.Begin);
-                for (var i = 0; i < length; i++)
-                {
-                    OutputStream.WriteByte((byte)read.ReadByte());
-                }
-            }
-        }
-    }
-}

+ 0 - 36
Masuit.Tools.Test/Mvc/Mocks/MockHttpSession.cs

@@ -1,36 +0,0 @@
-using System.Collections.Generic;
-using System.Web;
-
-namespace Masuit.Tools.Test.Mvc.Mocks
-{
-    public class MockHttpSession : HttpSessionStateBase
-    {
-        private readonly Dictionary<string, object> _sessionStorage = new Dictionary<string, object>();
-        private string _sessionId = "0000-0000";
-
-        public override object this[string name]
-        {
-            get
-            {
-                _sessionStorage.TryGetValue(name, out var val);
-                return val;
-            }
-            set => _sessionStorage[name] = value;
-        }
-
-        public void SetSessionId(string sessionId)
-        {
-            _sessionId = sessionId;
-        }
-
-        public override string SessionID => _sessionId;
-
-        public override void Remove(string name)
-        {
-            if (_sessionStorage.ContainsKey(name))
-            {
-                _sessionStorage.Remove(name);
-            }
-        }
-    }
-}

+ 0 - 8
Masuit.Tools.Test/Mvc/Mocks/MockRequestContext.cs

@@ -1,8 +0,0 @@
-using System.Web.Routing;
-
-namespace Masuit.Tools.Test.Mvc.Mocks
-{
-    public class MockRequestContext : RequestContext
-    {
-    }
-}

+ 0 - 46
Masuit.Tools.Test/Mvc/Mocks/MockResumeFileResult.cs

@@ -1,46 +0,0 @@
-using Masuit.Tools.Mvc.ActionResults;
-using System.Web;
-
-namespace Masuit.Tools.Test.Mvc.Mocks
-{
-    public class MockResumeFileResult : ResumeFileResult
-    {
-        public MockResumeFileResult(string fileName, HttpRequestBase request) : base(fileName, request)
-        {
-        }
-
-        public MockResumeFileResult(string fileName, HttpRequestBase request, string downloadFileName) : base(fileName, request, downloadFileName)
-        {
-        }
-
-        public new bool IsNotModified()
-        {
-            return base.IsNotModified();
-        }
-
-        public new bool IsPreconditionFailed()
-        {
-            return base.IsPreconditionFailed();
-        }
-
-        public new bool IsRangeNotSatisfiable()
-        {
-            return base.IsRangeNotSatisfiable();
-        }
-
-        public new bool SendRange()
-        {
-            return base.SendRange();
-        }
-
-        public void WriteFileTest(HttpResponseBase response)
-        {
-            base.WriteFile(response);
-        }
-
-        public void TransmitTest(HttpResponseBase response)
-        {
-            base.TransmitFile(response);
-        }
-    }
-}

+ 0 - 505
Masuit.Tools.Test/Mvc/ResumeFileResultTests.cs

@@ -1,505 +0,0 @@
-using Masuit.Tools.Mvc;
-using Masuit.Tools.Mvc.ActionResults;
-using Masuit.Tools.Test.Mvc.Mocks;
-using NUnit.Framework;
-using System;
-using System.IO;
-using System.Net;
-using System.Threading;
-
-namespace Masuit.Tools.Test.Mvc
-{
-    [TestFixture]
-    public class ResumeFileResultTests : BaseTests
-    {
-        private FileInfo _file;
-        private FileInfo _file2;
-
-        [SetUp]
-        public void Setup()
-        {
-            _file = new FileInfo(FilePath("download-test-file.txt"));
-            _file2 = new FileInfo(FilePath("download-test-file2.txt"));
-            Request.Headers.Clear();
-            Response.ClearTestResponse();
-        }
-
-        [Test]
-        public void CanCalculateEtagForFile()
-        {
-            Assert.IsNotNull(ResumeFileResult.Util.Etag(_file));
-        }
-
-        [Test]
-        public void EtagDoesNotDependOnTime()
-        {
-            var etag1 = ResumeFileResult.Util.Etag(_file);
-            Thread.Sleep(100);
-            var etag2 = ResumeFileResult.Util.Etag(_file);
-            Assert.AreEqual(etag1, etag2);
-        }
-
-        [Test]
-        public void EtagDoesDependOnFile()
-        {
-            var etag1 = ResumeFileResult.Util.Etag(_file);
-            Thread.Sleep(100);
-            var etag2 = ResumeFileResult.Util.Etag(_file2);
-            Assert.AreNotEqual(etag1, etag2);
-        }
-
-        [Test]
-        public void IsNotModified_Is_False_If_IfNoneMatch_And_IfModifiedSince_Are_Empty()
-        {
-            Request.Headers[HttpHeaders.IfNoneMatch] = null;
-            Request.Headers[HttpHeaders.IfModifiedSince] = null;
-            Assert.IsFalse(new MockResumeFileResult(_file.FullName, Request).IsNotModified());
-        }
-
-        [Test]
-        public void IsNotModified_Is_False_If_Etag_Is_Invalid_And_IfModifiedSince_Is_Null()
-        {
-            var etag = "invalid etag";
-            Request.Headers[HttpHeaders.IfNoneMatch] = etag;
-            Request.Headers[HttpHeaders.IfModifiedSince] = null;
-            Assert.IsFalse(new MockResumeFileResult(_file.FullName, Request).IsNotModified());
-        }
-
-        [Test]
-        public void IsNotModified_Is_True_If_Etag_Is_Valid()
-        {
-            var etag = ResumeFileResult.Util.Etag(_file);
-            Request.Headers[HttpHeaders.IfNoneMatch] = etag;
-            Assert.IsTrue(new MockResumeFileResult(_file.FullName, Request).IsNotModified());
-        }
-
-        [Test]
-        public void IsNotModified_Is_True_If_Etag_Is_Star()
-        {
-            var etag = "*";
-            Request.Headers[HttpHeaders.IfNoneMatch] = etag;
-            Assert.IsTrue(new MockResumeFileResult(_file.FullName, Request).IsNotModified());
-        }
-
-        [Test]
-        public void IsNotModified_Is_False_If_Etag_Is_Empty_And_IfModifiedSince_Is_Invalid()
-        {
-            Request.Headers[HttpHeaders.IfModifiedSince] = DateTime.Now.ToString("R");
-            Assert.IsFalse(new MockResumeFileResult(_file.FullName, Request).IsNotModified());
-        }
-
-        [Test]
-        public void IsNotModified_Is_False_If_Etag_Is_Empty_And_IfModifiedSince_Is_LastFileWriteTime()
-        {
-            Request.Headers[HttpHeaders.IfModifiedSince] = _file.LastWriteTime.ToString("R");
-            Assert.IsTrue(new MockResumeFileResult(_file.FullName, Request).IsNotModified());
-        }
-
-        [Test]
-        public void IsPreconditionFailedTest_Is_False_If_ifMatch_And_ifUnmodifiedSince_Are_Empty()
-        {
-            Request.Headers[HttpHeaders.IfMatch] = null;
-            Request.Headers[HttpHeaders.IfUnmodifiedSince] = null;
-            Assert.IsFalse(new MockResumeFileResult(_file.FullName, Request).IsPreconditionFailed());
-        }
-
-        [Test]
-        public void IsPreconditionFailedTest_Is_IsTrue_If_ifMatch_Doesnot_Match_Etag_Of_The_File()
-        {
-            Request.Headers[HttpHeaders.IfMatch] = "incorrect";
-            Assert.IsTrue(new MockResumeFileResult(_file.FullName, Request).IsPreconditionFailed());
-        }
-
-        [Test]
-        public void IsPreconditionFailedTest_Is_IsFalse_If_ifMatch_Matches_Etag_Of_The_File()
-        {
-            Request.Headers[HttpHeaders.IfMatch] = ResumeFileResult.Util.Etag(_file);
-            Assert.IsFalse(new MockResumeFileResult(_file.FullName, Request).IsPreconditionFailed());
-        }
-
-        [Test]
-        public void IsPreconditionFailedTest_Is_IsFalse_If_ifMatch_Equals_Star()
-        {
-            Request.Headers[HttpHeaders.IfMatch] = "*";
-            Assert.IsFalse(new MockResumeFileResult(_file.FullName, Request).IsPreconditionFailed());
-        }
-
-        [Test]
-        public void IsPreconditionFailedTest_Is_IsTrue_If_ifUnmodifiedSince_Doesnot_Equal_FileLastWriteTime()
-        {
-            Request.Headers[HttpHeaders.IfUnmodifiedSince] = DateTime.Now.ToString("R");
-            Assert.IsTrue(new MockResumeFileResult(_file.FullName, Request).IsPreconditionFailed());
-        }
-
-        [Test]
-        public void IsPreconditionFailedTest_Is_IsFalse_If_ifUnmodifiedSince_Equals_FileLastWriteTime()
-        {
-            Request.Headers[HttpHeaders.IfUnmodifiedSince] = _file.LastWriteTime.ToString("R");
-            Assert.IsFalse(new MockResumeFileResult(_file.FullName, Request).IsPreconditionFailed());
-        }
-
-        [Test]
-        public void IsRangeNotSatisfiable_Is_True_If_Range_Header_Has_Invalid_Format()
-        {
-            Request.Headers[HttpHeaders.Range] = "blah";
-            Assert.IsTrue(new MockResumeFileResult(_file.FullName, Request).IsRangeNotSatisfiable());
-        }
-
-        [Test]
-        public void IsRangeNotSatisfiable_Is_True_If_Start_Greater_Than_End()
-        {
-            Request.Headers[HttpHeaders.Range] = "bytes=100-0";
-            Assert.IsTrue(new MockResumeFileResult(_file.FullName, Request).IsRangeNotSatisfiable());
-        }
-
-        [Test]
-        public void IsRangeNotSatisfiable_Is_True_If_End_Equals_Total_File_Size()
-        {
-            Request.Headers[HttpHeaders.Range] = "bytes=0-" + _file.Length;
-            Assert.IsTrue(new MockResumeFileResult(_file.FullName, Request).IsRangeNotSatisfiable());
-        }
-
-        [Test]
-        public void IsRangeNotSatisfiable_Is_True_If_End_Greater_Than_Total_File_Size()
-        {
-            Request.Headers[HttpHeaders.Range] = "bytes=0-" + _file.Length + 10;
-            Assert.IsTrue(new MockResumeFileResult(_file.FullName, Request).IsRangeNotSatisfiable());
-        }
-
-        [Test]
-        public void IsRangeNotSatisfiable_Is_False_If_Range_Header_Is_Null()
-        {
-            Request.Headers[HttpHeaders.Range] = null;
-            Assert.IsFalse(new MockResumeFileResult(_file.FullName, Request).IsRangeNotSatisfiable());
-        }
-
-        [Test]
-        public void IsRangeNotSatisfiable_Is_False_If_Range_Has_StartsWith_Format()
-        {
-            Request.Headers[HttpHeaders.Range] = "bytes=0-";
-            Assert.IsFalse(new MockResumeFileResult(_file.FullName, Request).IsRangeNotSatisfiable());
-        }
-
-        [Test]
-        public void IsRangeNotSatisfiable_Is_False_If_Range_Has_LastXbytes_Format()
-        {
-            Request.Headers[HttpHeaders.Range] = "bytes=-100";
-            Assert.IsFalse(new MockResumeFileResult(_file.FullName, Request).IsRangeNotSatisfiable());
-        }
-
-        [Test]
-        public void IsRangeNotSatisfiable_Is_False_If_Range_Ends_With_Last_Byte_Position()
-        {
-            Request.Headers[HttpHeaders.Range] = "bytes=100-" + (_file.Length - 1);
-            Assert.IsFalse(new MockResumeFileResult(_file.FullName, Request).IsRangeNotSatisfiable());
-        }
-
-        [Test]
-        public void SendRange_Is_False_If_Range_And_ifRange_Headers_Are_Null()
-        {
-            Assert.IsFalse(new MockResumeFileResult(_file.FullName, Request).SendRange());
-        }
-
-        [Test]
-        public void SendRange_Is_False_If_Range_Is_Null_And_ifRange_Is_Correct()
-        {
-            Request.Headers[HttpHeaders.IfRange] = ResumeFileResult.Util.Etag(_file);
-            Assert.IsFalse(new MockResumeFileResult(_file.FullName, Request).SendRange());
-        }
-
-        [Test]
-        public void SendRange_Is_True_If_Range_Is_Correct_And_ifRange_Is_Null()
-        {
-            Request.Headers[HttpHeaders.Range] = "bytes=0-100";
-            Assert.IsTrue(new MockResumeFileResult(_file.FullName, Request).SendRange());
-        }
-
-        [Test]
-        public void SendRange_Is_True_If_Range_And_ifRange_Are_Correct()
-        {
-            Request.Headers[HttpHeaders.IfRange] = ResumeFileResult.Util.Etag(_file);
-            Request.Headers[HttpHeaders.Range] = "bytes=0-100";
-            Assert.IsTrue(new MockResumeFileResult(_file.FullName, Request).SendRange());
-        }
-
-        [Test]
-        public void SendRange_Is_False_If_Range_Is_Correct_But_ifRange_Is_InCorrect()
-        {
-            Request.Headers[HttpHeaders.IfRange] = "incorrect etag";
-            Request.Headers[HttpHeaders.Range] = "bytes=0-100";
-            Assert.IsFalse(new MockResumeFileResult(_file.FullName, Request).SendRange());
-        }
-
-        [Test]
-        public void HeadersTest_Should_Not_Send_File_If_File_Has_Not_Been_Changed()
-        {
-            Request.Headers[HttpHeaders.IfNoneMatch] = ResumeFileResult.Util.Etag(_file);
-            var result = new MockResumeFileResult(_file.FullName, Request);
-            Assert.IsTrue(result.IsNotModified());
-            result.WriteFileTest(Response);
-            Assert.AreEqual((int)HttpStatusCode.NotModified, Response.StatusCode);
-            Assert.IsNotNull(Response.Headers[HttpHeaders.Etag]);
-            Assert.IsNotNull(Response.Headers[HttpHeaders.Expires]);
-            Assert.IsNotNull(Response.Headers[HttpHeaders.LastModified]);
-            Assert.IsNull(Response.Headers[HttpHeaders.ContentRange]);
-            Assert.AreEqual(0, Response.OutputStream.Length);
-        }
-
-        [Test]
-        public void HeadersTest_Should_Not_Send_File_IfPreconditionFailed()
-        {
-            Request.Headers[HttpHeaders.IfMatch] = "invalid";
-            var result = new MockResumeFileResult(_file.FullName, Request);
-            Assert.IsTrue(result.IsPreconditionFailed());
-
-            result.WriteFileTest(Response);
-            Assert.AreEqual((int)HttpStatusCode.PreconditionFailed, Response.StatusCode);
-            Assert.IsNotNull(Response.Headers[HttpHeaders.Etag]);
-            Assert.IsNotNull(Response.Headers[HttpHeaders.Expires]);
-            Assert.IsNotNull(Response.Headers[HttpHeaders.LastModified]);
-            Assert.IsNull(Response.Headers[HttpHeaders.ContentRange]);
-            Assert.AreEqual(0, Response.OutputStream.Length);
-        }
-
-        [Test]
-        public void HeadersTest_Should_Not_Send_File_Is_RangeNotSatisfiable()
-        {
-            Request.Headers[HttpHeaders.Range] = "invalid";
-            var result = new MockResumeFileResult(_file.FullName, Request);
-            Assert.IsTrue(result.IsRangeNotSatisfiable());
-            result.WriteFileTest(Response);
-            Assert.AreEqual((int)HttpStatusCode.RequestedRangeNotSatisfiable, Response.StatusCode);
-            Assert.IsNotNull(Response.Headers[HttpHeaders.Etag]);
-            Assert.IsNotNull(Response.Headers[HttpHeaders.Expires]);
-            Assert.IsNotNull(Response.Headers[HttpHeaders.LastModified]);
-            Assert.AreEqual("bytes */" + _file.Length, Response.Headers[HttpHeaders.ContentRange]);
-            Assert.AreEqual(0, Response.OutputStream.Length);
-        }
-
-        [Test]
-        public void HeadersTest_Should_Send_File_If_All_Headers_Are_Null()
-        {
-            var result = new MockResumeFileResult(_file.FullName, Request);
-            result.WriteFileTest(Response);
-            Assert.AreEqual((int)HttpStatusCode.OK, Response.StatusCode);
-            Assert.IsNotNull(Response.Headers[HttpHeaders.Etag]);
-            Assert.IsNotNull(Response.Headers[HttpHeaders.Expires]);
-            Assert.IsNotNull(Response.Headers[HttpHeaders.LastModified]);
-            Assert.IsNotNull(Response.Headers[HttpHeaders.ContentRange]);
-            Assert.IsNotNull(Response.Headers[HttpHeaders.ContentLength]);
-            Assert.AreEqual(_file.Length, Response.OutputStream.Length);
-        }
-
-        [Test]
-        public void Range_First_500b()
-        {
-            var stream = GetResponseStream("bytes=0-499");
-            Assert.AreEqual(500, stream.Length);
-            Assert.AreEqual(206, Response.StatusCode);
-            Assert.AreEqual($"bytes 0-499/{_file.Length}", Response.Headers[HttpHeaders.ContentRange]);
-        }
-
-        [Test]
-        public void Range_From_500b_to_899b()
-        {
-            var stream = GetResponseStream("bytes=500-899");
-            Assert.AreEqual(400, stream.Length);
-            Assert.AreEqual(206, Response.StatusCode);
-            Assert.AreEqual($"bytes 500-899/{_file.Length}", Response.Headers[HttpHeaders.ContentRange]);
-        }
-
-        [Test]
-        public void Range_Last_300b()
-        {
-            var stream = GetResponseStream("bytes=-300");
-            Assert.AreEqual(300, stream.Length);
-            Assert.AreEqual(206, Response.StatusCode);
-            var from = _file.Length - 300;
-            var to = _file.Length - 1;
-
-            Assert.AreEqual($"bytes {from}-{to}/{_file.Length}", Response.Headers[HttpHeaders.ContentRange]);
-        }
-
-        [Test]
-        public void Range_From_100b_toThe_End()
-        {
-            var stream = GetResponseStream($"bytes={(_file.Length - 100)}-");
-            Assert.AreEqual(100, stream.Length);
-            Assert.AreEqual(206, Response.StatusCode);
-            var from = _file.Length - 100;
-            var to = _file.Length - 1;
-            Assert.AreEqual($"bytes {from}-{to}/{_file.Length}", Response.Headers[HttpHeaders.ContentRange]);
-        }
-
-        [Test]
-        public void Range_First_1b()
-        {
-            var stream = GetResponseStream("bytes=0-0");
-            Assert.AreEqual(1, stream.Length);
-            Assert.AreEqual(206, Response.StatusCode);
-            Assert.AreEqual($"bytes 0-0/{_file.Length}", Response.Headers[HttpHeaders.ContentRange]);
-        }
-
-        [Test]
-        public void Range_Last_1b()
-        {
-            var stream = GetResponseStream("bytes=-1");
-            Assert.AreEqual(1, stream.Length);
-            Assert.AreEqual(206, Response.StatusCode);
-            var from = _file.Length - 1;
-            var to = _file.Length - 1;
-            Assert.AreEqual($"bytes {from}-{to}/{_file.Length}", Response.Headers[HttpHeaders.ContentRange]);
-        }
-
-        [Test]
-        public void Range_Whole_File_With_RangeHeader()
-        {
-            var stream = GetResponseStream("bytes=0-" + (_file.Length - 1));
-            Assert.AreEqual(_file.Length, stream.Length);
-            Assert.AreEqual(206, Response.StatusCode);
-            Assert.AreEqual($"bytes 0-{(_file.Length - 1)}/{_file.Length}", Response.Headers[HttpHeaders.ContentRange]);
-        }
-
-        [Test]
-        public void Range_Whole_File_Without_RangeHeader()
-        {
-            var stream = GetResponseStream(null);
-            Assert.AreEqual(_file.Length, stream.Length);
-            Assert.AreEqual(200, Response.StatusCode);
-            Assert.AreEqual($"bytes 0-{(_file.Length - 1)}/{_file.Length}", Response.Headers[HttpHeaders.ContentRange]);
-        }
-
-        [Test]
-        public void TransmissionRange_From_0_To_0()
-        {
-            Request.Headers[HttpHeaders.Range] = "bytes=0-0";
-            new MockResumeFileResult(_file.FullName, Request).WriteFileTest(Response);
-
-            Assert.AreEqual(1, Response.OutputStream.Length);
-            AssertBytes(_file, Response.OutputStream, 0, 1);
-        }
-
-        [Test]
-        public void TransmissionRange_From_1_To_100()
-        {
-            Request.Headers[HttpHeaders.Range] = "bytes=1-100";
-            new MockResumeFileResult(_file.FullName, Request).WriteFileTest(Response);
-
-            Assert.AreEqual(100, Response.OutputStream.Length);
-            AssertBytes(_file, Response.OutputStream, 1, 100);
-        }
-
-        [Test]
-        public void TransmissionRange_From_101_To_theEnd()
-        {
-            Request.Headers[HttpHeaders.Range] = "bytes=101-";
-            new MockResumeFileResult(_file.FullName, Request).WriteFileTest(Response);
-
-            Assert.AreEqual(_file.Length - 101, Response.OutputStream.Length);
-            AssertBytes(_file, Response.OutputStream, 101, (int)_file.Length);
-        }
-
-        [Test]
-        public void TransmissionRange_WholeFile_WithRangeHeader()
-        {
-            Request.Headers[HttpHeaders.Range] = "bytes=0-";
-            new MockResumeFileResult(_file.FullName, Request).WriteFileTest(Response);
-
-            Assert.AreEqual(_file.Length, Response.OutputStream.Length);
-            AssertBytes(_file, Response.OutputStream, 0, (int)_file.Length);
-        }
-
-        [Test]
-        public void TransmissionRange_WholeFile_WithoutRangeHeader()
-        {
-            Request.Headers[HttpHeaders.Range] = null;
-            new MockResumeFileResult(_file.FullName, Request).WriteFileTest(Response);
-
-            Assert.AreEqual(_file.Length, Response.OutputStream.Length);
-            AssertBytes(_file, Response.OutputStream, 0, (int)_file.Length);
-        }
-
-        [Test]
-        public void ShouldSend206If_Range_HeaderExists()
-        {
-            Request.Headers[HttpHeaders.Range] = "bytes=0-";
-            new MockResumeFileResult(_file.FullName, Request).WriteFileTest(Response);
-            Assert.AreEqual(206, Response.StatusCode);
-        }
-
-        [Test]
-        public void ShouldSend200If_Range_HeaderDoesNotExist()
-        {
-            Request.Headers[HttpHeaders.Range] = null;
-            new MockResumeFileResult(_file.FullName, Request).WriteFileTest(Response);
-            Assert.AreEqual(200, Response.StatusCode);
-        }
-
-        [Test]
-        public void IfRangeHeader_Should_Be_Ignored_If_ItNotEquals_Etag()
-        {
-            Request.Headers[HttpHeaders.IfRange] = "ifRange fake header";
-            var mock = new MockResumeFileResult(_file.FullName, Request);
-            mock.WriteFileTest(Response);
-
-            Assert.AreNotEqual(ResumeFileResult.Util.Etag(_file), Request.Headers[HttpHeaders.IfRange]);
-            Assert.AreEqual(200, Response.StatusCode);
-        }
-
-        [Test]
-        public void Etag_Should_Be_Added_To_Response_If_It_Equals_With_IfRange_In_Request()
-        {
-            var etag = ResumeFileResult.Util.Etag(_file);
-            Request.Headers[HttpHeaders.IfRange] = etag;
-            var mock = new MockResumeFileResult(_file.FullName, Request);
-            mock.WriteFileTest(Response);
-            Assert.AreEqual(Response.Headers[HttpHeaders.Etag], etag);
-            Assert.AreEqual(200, Response.StatusCode);
-        }
-
-        [Test]
-        public void Etag_Should_Be_Added_To_Response_If_It_Equals_With_IfRange_In_Request__PartialResponse()
-        {
-            var etag = ResumeFileResult.Util.Etag(_file);
-            Request.Headers[HttpHeaders.IfRange] = etag;
-            Request.Headers[HttpHeaders.Range] = "bytes=0-";
-            new MockResumeFileResult(_file.FullName, Request).WriteFileTest(Response);
-            Assert.AreEqual(Response.Headers[HttpHeaders.Etag], etag);
-            Assert.IsNotNull(Response.Headers[HttpHeaders.ContentRange]);
-            Assert.AreEqual(206, Response.StatusCode);
-        }
-
-        [Test]
-        public void It_Should_Attach_Content_Disposition_If_There_Is_Download_File_Name()
-        {
-            new MockResumeFileResult(_file.FullName, Request, "test.name").WriteFileTest(Response);
-            Assert.IsNotNull(Response.Headers[HttpHeaders.ContentDisposition]);
-        }
-
-        private Stream GetResponseStream(string range)
-        {
-            Response.ClearTestResponse();
-            Response.StatusCode = 500;
-
-            Request.Headers[HttpHeaders.Range] = range;
-            new MockResumeFileResult(_file.FullName, Request).WriteFileTest(Response);
-
-            return Response.OutputStream;
-        }
-
-        private void AssertBytes(FileInfo file, Stream responseStream, int from, int to)
-        {
-            using (var fileStream = file.OpenRead())
-            {
-                responseStream.Seek(0, SeekOrigin.Begin);
-                fileStream.Seek(from, SeekOrigin.Begin);
-                for (var byteIndex = from ; byteIndex < to ; byteIndex++)
-                {
-                    var responseByte = responseStream.ReadByte();
-                    var fileByte = fileStream.ReadByte();
-                    Assert.AreEqual(responseByte, fileByte);
-                }
-            }
-        }
-    }
-}

+ 0 - 60
Masuit.Tools.Test/NumberFormaterTest.cs

@@ -1,60 +0,0 @@
-using Masuit.Tools.Strings;
-using Xunit;
-
-namespace Masuit.Tools.Test
-{
-    public class NumberFormaterTest
-    {
-        [Theory]
-        [InlineData(2, 16, "10000")]
-        [InlineData(8, 8, "10")]
-        [InlineData(16, 16, "10")]
-        [InlineData(36, 36, "10")]
-        [InlineData(62, 62, "10")]
-        public void Can_ConvertOct2AnySystem(int bin, long input, string expectOutput)
-        {
-            var nf = new NumberFormater(bin);
-            string output = nf.ToString(input);
-            Assert.Equal(expectOutput, output);
-        }
-
-        [Theory]
-        [InlineData(2, "10000", 16)]
-        [InlineData(8, "10", 8)]
-        [InlineData(16, "10", 16)]
-        [InlineData(36, "10", 36)]
-        [InlineData(62, "10", 62)]
-        public void Can_ConvertAnySystem2Oct(int bin, string input, long expected)
-        {
-            var nf = new NumberFormater(bin);
-            string output = nf.ToString(expected);
-            Assert.Equal(input, output);
-        }
-
-        [Fact]
-        public void Can_ConvertAnyNum2Chinese()
-        {
-            // arrange
-            double num = 1234567809.321;
-
-            // act
-            var chineseNumber = NumberFormater.ToChineseNumber(num);
-
-            // assert
-            Assert.Equal("十二亿三千四百五十六万七千八百零九点三二一", chineseNumber);
-        }
-
-        [Fact]
-        public void Can_ConvertAnyNum2ChineseMoney()
-        {
-            // arrange
-            double num = 123456789.321;
-
-            // act
-            var chineseNumber = NumberFormater.ToChineseMoney(num);
-
-            // assert
-            Assert.Equal("壹億贰仟叁佰肆拾伍萬陆仟柒佰捌拾玖元叁角贰分", chineseNumber);
-        }
-    }
-}

+ 0 - 20
Masuit.Tools.Test/Properties/AssemblyInfo.cs

@@ -1,20 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-[assembly: AssemblyTitle("Masuit.Tools.Test")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Masuit.Tools.Test")]
-[assembly: AssemblyCopyright("Copyright ©  2020")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-[assembly: ComVisible(false)]
-
-[assembly: Guid("ab9f4635-0acb-4e5e-8e1b-431e0818cf60")]
-
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]

+ 0 - 27
Masuit.Tools.Test/RSATest.cs

@@ -1,27 +0,0 @@
-using Masuit.Tools.Security;
-using Xunit;
-
-namespace Masuit.Tools.Test
-{
-    public class RSATest
-    {
-        [Fact]
-        public void Can_Encrypt()
-        {
-            string publicKey = "<RSAKeyValue><Modulus>w1f5E3UyxPseWA0DKU6hpN/4WetQA8llIsO4YQx+m7wGzhbDTMmx7ScGZlyHAXYaSisUzNMIBJOIEsCtQsH/q2r7kOm7tQqnjYdaBgFrY/LnpsvVCS8mkQylbkdiZyusV09H3zcQ4KOwNUUm0m2wyBY5KoT3m8j1pcIk8id97SU=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
-            string origin = "123456";
-            string enc = origin.RSAEncrypt(publicKey);
-            string dec = enc.RSADecrypt("<RSAKeyValue><Modulus>w1f5E3UyxPseWA0DKU6hpN/4WetQA8llIsO4YQx+m7wGzhbDTMmx7ScGZlyHAXYaSisUzNMIBJOIEsCtQsH/q2r7kOm7tQqnjYdaBgFrY/LnpsvVCS8mkQylbkdiZyusV09H3zcQ4KOwNUUm0m2wyBY5KoT3m8j1pcIk8id97SU=</Modulus><Exponent>AQAB</Exponent><P>0WSGgAK4Xan/2q0oNaVI8CRgLaD9xqK73EkKRumlC44fDTIcXE0vIaPsXeC8A+vHAFjDhC2MEbf30DW2sd2Y+w==</P><Q>7tLqNhL3zQ+8jblh17T9a+nbpQIG54igOlwc3jwa8kUm2rr+QRTUI5MP+diqQoT7z4o1oxFP6+Lsy2dXvv34Xw==</Q><DP>sgvWShcGCa65vYmrPSJUCM4FcgcIgtRxBPieYnndOxwXzzKi5uFCiEpIe/LSLEtZpTPU3BmWlqJld4eU11zj7Q==</DP><DQ>tDZJb6ZegMloIZWKxEeZl02vZVMjPKF3LrKFQhkeyEPwLss9woRiE7oMKx8YUvugPBpxoOwWX8wrnM0NhFyGhw==</DQ><InverseQ>S7ynBGzvO0HQ9+SKiBdz4Sgn7hntSJI7WcHZksfj3R9iN/L1pWVuMSdMg1fI1FUX9heciV2u1QMARYvUNeU5xQ==</InverseQ><D>JqpHFt7fybWa7/rDYW26+ROL6OB22gkHB7aNzEfY16KEBk7jIVPa8AIFdkViQ5vI4F1epJwwvhclm/CfWtNjc4XlhCo09koMnJPvxd0tdhnhtxbUG6gcEQOQUoQoVT7x9Evs33U78307qVT1j67FMUYW0Xanlu79a7Xgt+XyhRE=</D></RSAKeyValue>");
-            Assert.Equal(dec, origin);
-        }
-
-        [Fact]
-        public void Can_EncryptAuto()
-        {
-            string origin = "123456";
-            string enc = origin.RSAEncrypt();
-            string dec = enc.RSADecrypt();
-            Assert.Equal(dec, origin);
-        }
-    }
-}

+ 0 - 52
Masuit.Tools.Test/Reflection/ClassHelperTest.cs

@@ -1,52 +0,0 @@
-using Masuit.Tools.Reflection;
-using System.Collections.Generic;
-using Xunit;
-
-namespace Masuit.Tools.Test
-{
-    public class ClassHelperTest
-    {
-        [Fact]
-        public void Can_AddProperty_ReturnNewInstance()
-        {
-            // arrange
-            MyClass myClass = new MyClass();
-
-            // act
-            dynamic newObj = myClass.AddProperty(new List<ClassHelper.CustPropertyInfo>()
-            {
-                new ClassHelper.CustPropertyInfo(typeof(string),"Name","张三"),
-                new ClassHelper.CustPropertyInfo(typeof(int),"Age",20),
-            }).AddProperty("List", new List<string>());
-
-            // act
-            Assert.Equal("张三", newObj.Name);
-            Assert.Equal(20, newObj.Age);
-            Assert.IsType<List<string>>(newObj.List);
-        }
-
-        [Fact]
-        public void Can_RemoveProperty_ReturnNewInstance()
-        {
-            // arrange
-            MyClass myClass = new MyClass()
-            {
-                MyProperty = "aa",
-                Number = 123
-            };
-
-            // act
-            object newObj = myClass.DeleteProperty("MyProperty");
-
-            // act
-            int propertyCount = newObj.GetType().GetProperties().Length;
-            Assert.Equal(1, propertyCount);
-        }
-    }
-
-    public class MyClass
-    {
-        public string MyProperty { get; set; }
-        public int Number { get; set; }
-    }
-}

+ 0 - 44
Masuit.Tools.Test/TemplateTest.cs

@@ -1,44 +0,0 @@
-using Masuit.Tools.Strings;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using System;
-using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert;
-
-namespace Masuit.Tools.Test
-{
-    [TestClass]
-    public class TemplateTest
-    {
-        [TestMethod]
-        public void Render_Template()
-        {
-            var tmp = new Template("{{name}},你好!");
-            tmp.Set("name", "万金油");
-            string s = tmp.Render();
-            Assert.AreEqual("万金油,你好!", s);
-        }
-
-        [TestMethod]
-        public void Render_TemplateWithMultiVariables()
-        {
-            var tmp = new Template("{{one}},{{two}},{{three}}");
-            string s = tmp.Set("one", "1").Set("two", "2").Set("three", "3").Render();
-            Assert.AreEqual("1,2,3", s);
-        }
-
-        [TestMethod]
-        public void Render_TemplateWithUncoverVariable()
-        {
-            var tmp = new Template("{{name}},{{greet}}!");
-            tmp.Set("name", "万金油");
-            try
-            {
-                string s = tmp.Render();
-            }
-            catch (Exception e)
-            {
-                Assert.IsInstanceOfType(e, typeof(ArgumentException));
-                Assert.AreEqual("模版变量{{greet}}未被使用", e.Message);
-            }
-        }
-    }
-}

+ 0 - 19
Masuit.Tools.Test/app.config

@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
-  <runtime>
-    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
-      <dependentAssembly>
-        <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
-      </dependentAssembly>
-    </assemblyBinding>
-  </runtime>
-</configuration>

+ 0 - 22
Masuit.Tools.Test/packages.config

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
-  <package id="Castle.Core" version="4.4.1" targetFramework="net461" />
-  <package id="Microsoft.AspNet.Mvc" version="5.2.7" targetFramework="net461" />
-  <package id="Microsoft.AspNet.Razor" version="3.2.7" targetFramework="net461" />
-  <package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net461" />
-  <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net461" />
-  <package id="Moq" version="4.14.5" targetFramework="net461" />
-  <package id="MSTest.TestAdapter" version="2.1.2" targetFramework="net461" />
-  <package id="MSTest.TestFramework" version="2.1.2" targetFramework="net461" />
-  <package id="NUnit" version="3.12.0" targetFramework="net461" />
-  <package id="System.Runtime.CompilerServices.Unsafe" version="4.7.1" targetFramework="net461" />
-  <package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net461" />
-  <package id="System.ValueTuple" version="4.5.0" targetFramework="net461" />
-  <package id="xunit" version="2.4.1" targetFramework="net461" />
-  <package id="xunit.abstractions" version="2.0.3" targetFramework="net461" />
-  <package id="xunit.analyzers" version="0.10.0" targetFramework="net461" />
-  <package id="xunit.assert" version="2.4.1" targetFramework="net461" />
-  <package id="xunit.core" version="2.4.1" targetFramework="net461" />
-  <package id="xunit.extensibility.core" version="2.4.1" targetFramework="net461" />
-  <package id="xunit.extensibility.execution" version="2.4.1" targetFramework="net461" />
-</packages>

+ 1 - 1
Masuit.Tools.sln

@@ -28,7 +28,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masuit.Tools.AspNetCore.Res
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masuit.Tools.ExpressionMapperBenchmark", "Test\Masuit.Tools.ExpressionMapperBenchmark\Masuit.Tools.ExpressionMapperBenchmark.csproj", "{B5657BBC-E50E-4CAD-B78B-6E2CCB139F98}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masuit.Tools.Test", "Masuit.Tools.Test\Masuit.Tools.Test.csproj", "{AB9F4635-0ACB-4E5E-8E1B-431E0818CF60}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masuit.Tools.Test", "Test\Masuit.Tools.Test\Masuit.Tools.Test.csproj", "{AB9F4635-0ACB-4E5E-8E1B-431E0818CF60}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution

+ 35 - 42
Test/Masuit.Tools.Test/Masuit.Tools.Test.csproj

@@ -1,14 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="..\..\packages\xunit.core.2.4.1\build\xunit.core.props" Condition="Exists('..\..\packages\xunit.core.2.4.1\build\xunit.core.props')" />
-  <Import Project="..\..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\..\packages\NUnit.3.12.0\build\NUnit.props')" />
-  <Import Project="..\..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props')" />
-  <Import Project="..\..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props')" />
+  <Import Project="..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props')" />
+  <Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" />
+  <Import Project="..\packages\xunit.core.2.4.1\build\xunit.core.props" Condition="Exists('..\packages\xunit.core.2.4.1\build\xunit.core.props')" />
   <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{92F3DA7E-669A-4A6D-AC8B-018CABCBEFB9}</ProjectGuid>
+    <ProjectGuid>{AB9F4635-0ACB-4E5E-8E1B-431E0818CF60}</ProjectGuid>
     <OutputType>Library</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>Masuit.Tools.Test</RootNamespace>
@@ -43,66 +42,67 @@
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Castle.Core.4.4.1\lib\net45\Castle.Core.dll</HintPath>
+      <HintPath>..\packages\Castle.Core.4.4.1\lib\net45\Castle.Core.dll</HintPath>
     </Reference>
+    <Reference Include="Microsoft.CSharp" />
     <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\MSTest.TestFramework.2.1.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
+      <HintPath>..\packages\MSTest.TestFramework.2.1.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\MSTest.TestFramework.2.1.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
+      <HintPath>..\packages\MSTest.TestFramework.2.1.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
+      <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
     </Reference>
     <Reference Include="Moq, Version=4.14.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Moq.4.14.5\lib\net45\Moq.dll</HintPath>
+      <HintPath>..\packages\Moq.4.14.5\lib\net45\Moq.dll</HintPath>
     </Reference>
     <Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
+      <HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Configuration" />
     <Reference Include="System.Core" />
     <Reference Include="System.Numerics" />
     <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Runtime.CompilerServices.Unsafe.4.7.1\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
+      <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.7.1\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
     </Reference>
     <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
+      <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
     </Reference>
     <Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
+      <HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
     </Reference>
     <Reference Include="System.Web" />
     <Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll</HintPath>
+      <HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll</HintPath>
+      <HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll</HintPath>
+      <HintPath>..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll</HintPath>
+      <HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
+      <HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
+      <HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
     </Reference>
     <Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\xunit.abstractions.2.0.3\lib\net35\xunit.abstractions.dll</HintPath>
+      <HintPath>..\packages\xunit.abstractions.2.0.3\lib\net35\xunit.abstractions.dll</HintPath>
     </Reference>
     <Reference Include="xunit.assert, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\xunit.assert.2.4.1\lib\netstandard1.1\xunit.assert.dll</HintPath>
+      <HintPath>..\packages\xunit.assert.2.4.1\lib\netstandard1.1\xunit.assert.dll</HintPath>
     </Reference>
     <Reference Include="xunit.core, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\xunit.extensibility.core.2.4.1\lib\net452\xunit.core.dll</HintPath>
+      <HintPath>..\packages\xunit.extensibility.core.2.4.1\lib\net452\xunit.core.dll</HintPath>
     </Reference>
     <Reference Include="xunit.execution.desktop, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\xunit.extensibility.execution.2.4.1\lib\net452\xunit.execution.desktop.dll</HintPath>
+      <HintPath>..\packages\xunit.extensibility.execution.2.4.1\lib\net452\xunit.execution.desktop.dll</HintPath>
     </Reference>
   </ItemGroup>
   <ItemGroup>
@@ -131,16 +131,9 @@
     <None Include="app.config" />
     <None Include="packages.config" />
   </ItemGroup>
-  <ItemGroup>
-    <Analyzer Include="..\..\packages\xunit.analyzers.0.10.0\analyzers\dotnet\cs\xunit.analyzers.dll" />
-  </ItemGroup>
-  <ItemGroup>
-    <Content Include="Resources\download-test-file.txt" />
-    <Content Include="Resources\download-test-file2.txt" />
-  </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\..\Masuit.Tools.Abstractions\Masuit.Tools.Abstractions.csproj">
-      <Project>{74E7C0A2-499D-408F-A2E4-08878700C2DE}</Project>
+      <Project>{74e7c0a2-499d-408f-a2e4-08878700c2de}</Project>
       <Name>Masuit.Tools.Abstractions</Name>
     </ProjectReference>
     <ProjectReference Include="..\..\Masuit.Tools\Masuit.Tools.csproj">
@@ -148,21 +141,21 @@
       <Name>Masuit.Tools</Name>
     </ProjectReference>
   </ItemGroup>
+  <ItemGroup>
+    <Analyzer Include="..\packages\xunit.analyzers.0.10.0\analyzers\dotnet\cs\xunit.analyzers.dll" />
+  </ItemGroup>
   <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
     <PropertyGroup>
       <ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
     </PropertyGroup>
-    <Error Condition="!Exists('..\..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props'))" />
-    <Error Condition="!Exists('..\..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets'))" />
-    <Error Condition="!Exists('..\..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props'))" />
-    <Error Condition="!Exists('..\..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets'))" />
-    <Error Condition="!Exists('..\..\packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NUnit.3.12.0\build\NUnit.props'))" />
-    <Error Condition="!Exists('..\..\packages\xunit.core.2.4.1\build\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.core.2.4.1\build\xunit.core.props'))" />
-    <Error Condition="!Exists('..\..\packages\xunit.core.2.4.1\build\xunit.core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.core.2.4.1\build\xunit.core.targets'))" />
+    <Error Condition="!Exists('..\packages\xunit.core.2.4.1\build\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.4.1\build\xunit.core.props'))" />
+    <Error Condition="!Exists('..\packages\xunit.core.2.4.1\build\xunit.core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.4.1\build\xunit.core.targets'))" />
+    <Error Condition="!Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.12.0\build\NUnit.props'))" />
+    <Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props'))" />
+    <Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets'))" />
   </Target>
-  <Import Project="..\..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets')" />
-  <Import Project="..\..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets')" />
-  <Import Project="..\..\packages\xunit.core.2.4.1\build\xunit.core.targets" Condition="Exists('..\..\packages\xunit.core.2.4.1\build\xunit.core.targets')" />
+  <Import Project="..\packages\xunit.core.2.4.1\build\xunit.core.targets" Condition="Exists('..\packages\xunit.core.2.4.1\build\xunit.core.targets')" />
+  <Import Project="..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets')" />
 </Project>

+ 1 - 1
Test/Masuit.Tools.Test/Properties/AssemblyInfo.cs

@@ -13,7 +13,7 @@ using System.Runtime.InteropServices;
 
 [assembly: ComVisible(false)]
 
-[assembly: Guid("92f3da7e-669a-4a6d-ac8b-018cabcbefb9")]
+[assembly: Guid("ab9f4635-0acb-4e5e-8e1b-431e0818cf60")]
 
 // [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("1.0.0.0")]

+ 6 - 2
Test/Masuit.Tools.Test/app.config

@@ -3,13 +3,17 @@
   <runtime>
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
-        <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
+        <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
       </dependentAssembly>
       <dependentAssembly>
         <assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
         <bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
       </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
+      </dependentAssembly>
     </assemblyBinding>
   </runtime>
 </configuration>