alarm sample: basic flow unit test
This commit is contained in:
Родитель
b1b8b41412
Коммит
20eb92ff20
|
@ -64,13 +64,13 @@ namespace Microsoft.Bot.Builder
|
|||
return formatter;
|
||||
}
|
||||
|
||||
public static async Task<Message> SendAsync(Message toBot, Func<IDialog> MakeRoot, CancellationToken token = default(CancellationToken))
|
||||
public static async Task<Message> SendAsync(Message toBot, Func<IDialog> MakeRoot, CancellationToken token = default(CancellationToken), params object[] singletons)
|
||||
{
|
||||
var waits = new WaitFactory();
|
||||
var frames = new FrameFactory(waits);
|
||||
IWaitFactory waits = new WaitFactory();
|
||||
IFrameFactory frames = new FrameFactory(waits);
|
||||
IBotData toBotData = new Internals.JObjectBotData(toBot);
|
||||
IConnectorClient client = new ConnectorClient();
|
||||
var provider = new Serialization.SimpleServiceLocator()
|
||||
var provider = new Serialization.SimpleServiceLocator(singletons)
|
||||
{
|
||||
waits, frames, toBotData, client
|
||||
};
|
||||
|
|
|
@ -52,10 +52,22 @@ namespace Microsoft.Bot.Builder.Fibers
|
|||
Field.SetNotNullFrom(out this.type, nameof(type), info);
|
||||
}
|
||||
|
||||
public static Type MapMockedType(Type type)
|
||||
{
|
||||
// special case for Moq
|
||||
if (type.Assembly.IsDynamic)
|
||||
{
|
||||
var info = type.GetTypeInfo();
|
||||
return info.ImplementedInterfaces.First();
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
public static void GetObjectData(SerializationInfo info, Type type)
|
||||
{
|
||||
info.SetType(typeof(ObjectReference));
|
||||
info.AddValue(nameof(type), type);
|
||||
info.AddValue(nameof(type), MapMockedType(type));
|
||||
}
|
||||
|
||||
object IObjectReference.GetRealObject(StreamingContext context)
|
||||
|
@ -219,8 +231,24 @@ namespace Microsoft.Bot.Builder.Fibers
|
|||
object IServiceProvider.GetService(Type serviceType)
|
||||
{
|
||||
object service;
|
||||
this.instanceByType.TryGetValue(serviceType, out service);
|
||||
return service;
|
||||
if (this.instanceByType.TryGetValue(serviceType, out service))
|
||||
{
|
||||
return service;
|
||||
}
|
||||
else
|
||||
{
|
||||
// special case for Moq
|
||||
foreach (var instance in this.instanceByType.Values)
|
||||
{
|
||||
var type = instance.GetType();
|
||||
if (serviceType.IsAssignableFrom(type))
|
||||
{
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,174 @@
|
|||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
//
|
||||
// Microsoft Bot Framework: http://botframework.com
|
||||
//
|
||||
// Bot Builder SDK Github:
|
||||
// https://github.com/Microsoft/BotBuilder
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// MIT License:
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Moq;
|
||||
|
||||
using Microsoft.Bot.Connector;
|
||||
using Microsoft.Bot.Builder;
|
||||
using Microsoft.Bot.Builder.Models;
|
||||
using Microsoft.Bot.Sample.SimpleAlarmBot;
|
||||
|
||||
namespace Microsoft.Bot.Sample.Tests
|
||||
{
|
||||
[TestClass]
|
||||
public sealed class AlarmBotTests
|
||||
{
|
||||
public static IntentRecommendation[] IntentsFor(Expression<Func<SimpleAlarmBot.SimpleAlarmDialog, Task>> expression)
|
||||
{
|
||||
var body = (MethodCallExpression)expression.Body;
|
||||
var attribute = body.Method.GetCustomAttribute<LuisIntent>();
|
||||
var name = attribute.intentName;
|
||||
var intent = new IntentRecommendation(name);
|
||||
return new[] { intent };
|
||||
}
|
||||
|
||||
public static EntityRecommendation EntityFor(string type, string entity)
|
||||
{
|
||||
return new EntityRecommendation(type) { Entity = entity };
|
||||
}
|
||||
|
||||
public static void SetupLuis(
|
||||
Mock<ILuisService> luis,
|
||||
Expression<Func<SimpleAlarmBot.SimpleAlarmDialog, Task>> expression,
|
||||
params EntityRecommendation[] entities
|
||||
)
|
||||
{
|
||||
luis
|
||||
.Setup(l => l.QueryAsync(It.IsAny<Uri>()))
|
||||
.ReturnsAsync(new LuisResult()
|
||||
{
|
||||
Intents = IntentsFor(expression),
|
||||
Entities = entities
|
||||
});
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task AlarmDialogFlow()
|
||||
{
|
||||
var luis = new Mock<ILuisService>();
|
||||
|
||||
// arrange
|
||||
var now = DateTime.UtcNow;
|
||||
var entityTitle = EntityFor(SimpleAlarmBot.SimpleAlarmDialog.Entity_Alarm_Title, "title");
|
||||
var entityDate = EntityFor(SimpleAlarmBot.SimpleAlarmDialog.Entity_Alarm_Start_Date, now.ToShortDateString());
|
||||
var entityTime = EntityFor(SimpleAlarmBot.SimpleAlarmDialog.Entity_Alarm_Start_Time, now.ToShortTimeString());
|
||||
SetupLuis(luis, a => a.SetAlarm(null, null), entityTitle, entityDate, entityTitle);
|
||||
|
||||
Func<IDialog> MakeRoot = () => new SimpleAlarmBot.SimpleAlarmDialog(luis.Object);
|
||||
var toBot = new Message() { ConversationId = Guid.NewGuid().ToString() };
|
||||
|
||||
// act
|
||||
var toUser = await Conversation.SendAsync(toBot, MakeRoot, default(CancellationToken), luis.Object);
|
||||
|
||||
// assert
|
||||
luis.VerifyAll();
|
||||
Assert.IsTrue(toUser.Text.Contains("created"));
|
||||
|
||||
|
||||
// arrange
|
||||
SetupLuis(luis, a => a.FindAlarm(null, null), entityTitle);
|
||||
|
||||
// act
|
||||
toUser = await Conversation.SendAsync(toBot, MakeRoot, default(CancellationToken), luis.Object);
|
||||
|
||||
// assert
|
||||
luis.VerifyAll();
|
||||
Assert.IsTrue(toUser.Text.Contains("found"));
|
||||
|
||||
|
||||
// arrange
|
||||
SetupLuis(luis, a => a.AlarmSnooze(null, null), entityTitle);
|
||||
|
||||
// act
|
||||
toUser = await Conversation.SendAsync(toBot, MakeRoot, default(CancellationToken), luis.Object);
|
||||
|
||||
// assert
|
||||
luis.VerifyAll();
|
||||
Assert.IsTrue(toUser.Text.Contains("snoozed"));
|
||||
|
||||
|
||||
// arrange
|
||||
SetupLuis(luis, a => a.TurnOffAlarm(null, null), entityTitle);
|
||||
|
||||
// act
|
||||
toUser = await Conversation.SendAsync(toBot, MakeRoot, default(CancellationToken), luis.Object);
|
||||
|
||||
// assert
|
||||
luis.VerifyAll();
|
||||
Assert.IsTrue(toUser.Text.Contains("sure"));
|
||||
|
||||
|
||||
// arrange
|
||||
toBot.Text = "blah";
|
||||
|
||||
// act
|
||||
toUser = await Conversation.SendAsync(toBot, MakeRoot, default(CancellationToken), luis.Object);
|
||||
|
||||
// assert
|
||||
luis.VerifyAll();
|
||||
Assert.IsTrue(toUser.Text.Contains("sure"));
|
||||
|
||||
|
||||
// arrange
|
||||
toBot.Text = "yes";
|
||||
|
||||
// act
|
||||
toUser = await Conversation.SendAsync(toBot, MakeRoot, default(CancellationToken), luis.Object);
|
||||
|
||||
// assert
|
||||
luis.VerifyAll();
|
||||
Assert.IsTrue(toUser.Text.Contains("disabled"));
|
||||
|
||||
|
||||
// arrange
|
||||
SetupLuis(luis, a => a.DeleteAlarm(null, null), entityTitle);
|
||||
|
||||
// act
|
||||
toUser = await Conversation.SendAsync(toBot, MakeRoot, default(CancellationToken), luis.Object);
|
||||
|
||||
// assert
|
||||
luis.VerifyAll();
|
||||
Assert.IsTrue(toUser.Text.Contains("did not find"));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,144 +1,149 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\packages\Microsoft.Net.Compilers.1.1.1\build\Microsoft.Net.Compilers.props" Condition="Exists('..\..\packages\Microsoft.Net.Compilers.1.1.1\build\Microsoft.Net.Compilers.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{04DD63E9-0323-41B1-9949-EA6ABF005E86}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.Bot.Sample.Tests</RootNamespace>
|
||||
<AssemblyName>Microsoft.Bot.Sample.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.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>
|
||||
<TargetFrameworkProfile />
|
||||
<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>
|
||||
<NoWarn>CS1998</NoWarn>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</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="Microsoft.Bot.Connector, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.Bot.Connector.1.0.0.0\lib\net45\Microsoft.Bot.Connector.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bot.Connector.Utilities, Version=0.9.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.Bot.Connector.1.0.0.0\lib\net45\Microsoft.Bot.Connector.Utilities.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.Rest.ClientRuntime, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.Rest.ClientRuntime.1.8.2\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.1\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http.WebRequest" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<Choose>
|
||||
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||
</ItemGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
|
||||
</ItemGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
<ItemGroup>
|
||||
<Compile Include="EchoBotTests.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Library\Microsoft.Bot.Builder.csproj">
|
||||
<Project>{cdfec7d6-847e-4c13-956b-0a960ae3eb60}</Project>
|
||||
<Name>Microsoft.Bot.Builder</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Samples\EchoBot\Microsoft.Bot.Sample.EchoBot.csproj">
|
||||
<Project>{D2253234-1279-486E-8A63-D8C3424E0525}</Project>
|
||||
<Name>Microsoft.Bot.Sample.EchoBot</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Samples\SimpleAlarmBot\Microsoft.Bot.Sample.SimpleAlarmBot.csproj">
|
||||
<Project>{a8ba1066-5695-4d71-abb4-65e5a5e0c3d4}</Project>
|
||||
<Name>Microsoft.Bot.Sample.SimpleAlarmBot</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\packages\Microsoft.Net.Compilers.1.1.1\build\Microsoft.Net.Compilers.props" Condition="Exists('..\..\packages\Microsoft.Net.Compilers.1.1.1\build\Microsoft.Net.Compilers.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{04DD63E9-0323-41B1-9949-EA6ABF005E86}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.Bot.Sample.Tests</RootNamespace>
|
||||
<AssemblyName>Microsoft.Bot.Sample.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.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>
|
||||
<TargetFrameworkProfile />
|
||||
<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>
|
||||
<NoWarn>CS1998</NoWarn>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</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="Microsoft.Bot.Connector, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.Bot.Connector.1.0.0.0\lib\net45\Microsoft.Bot.Connector.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bot.Connector.Utilities, Version=0.9.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.Bot.Connector.1.0.0.0\lib\net45\Microsoft.Bot.Connector.Utilities.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.Rest.ClientRuntime, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.Rest.ClientRuntime.1.8.2\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.1\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Moq, Version=4.2.1510.2205, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http.WebRequest" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<Choose>
|
||||
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||
</ItemGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
|
||||
</ItemGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
<ItemGroup>
|
||||
<Compile Include="AlarmBotTests.cs" />
|
||||
<Compile Include="EchoBotTests.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Library\Microsoft.Bot.Builder.csproj">
|
||||
<Project>{cdfec7d6-847e-4c13-956b-0a960ae3eb60}</Project>
|
||||
<Name>Microsoft.Bot.Builder</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Samples\EchoBot\Microsoft.Bot.Sample.EchoBot.csproj">
|
||||
<Project>{D2253234-1279-486E-8A63-D8C3424E0525}</Project>
|
||||
<Name>Microsoft.Bot.Sample.EchoBot</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Samples\SimpleAlarmBot\Microsoft.Bot.Sample.SimpleAlarmBot.csproj">
|
||||
<Project>{a8ba1066-5695-4d71-abb4-65e5a5e0c3d4}</Project>
|
||||
<Name>Microsoft.Bot.Sample.SimpleAlarmBot</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="packages.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Choose>
|
||||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
</When>
|
||||
</Choose>
|
||||
<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>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.Net.Compilers.1.1.1\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Net.Compilers.1.1.1\build\Microsoft.Net.Compilers.props'))" />
|
||||
</Target>
|
||||
</ItemGroup>
|
||||
<Choose>
|
||||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
</When>
|
||||
</Choose>
|
||||
<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>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.Net.Compilers.1.1.1\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Net.Compilers.1.1.1\build\Microsoft.Net.Compilers.props'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
-->
|
||||
</Project>
|
|
@ -4,5 +4,6 @@
|
|||
<package id="Microsoft.Net.Compilers" version="1.1.1" targetFramework="net46" developmentDependency="true" />
|
||||
<package id="Microsoft.Rest.ClientRuntime" version="1.8.2" targetFramework="net46" />
|
||||
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="3.2.1" targetFramework="net46" />
|
||||
<package id="Moq" version="4.2.1510.2205" targetFramework="net46" />
|
||||
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net46" />
|
||||
</packages>
|
Загрузка…
Ссылка в новой задаче