-
Notifications
You must be signed in to change notification settings - Fork 0
/
AccountTest.cs
38 lines (31 loc) · 1.15 KB
/
AccountTest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System.Collections.Generic;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Messages;
using Moq;
using NUnit.Framework;
using Plugins;
namespace PluginsTest
{
public class AccountTest
{
[TestCase("Ontological", 0)]
[TestCase("Bastion", 100000000)]
[TestCase("bastion", 100000000)]
[TestCase("Distress", 100000001)]
[TestCase("diamon", 100000001)]
[TestCase("Yahoo", 100000004)]
[TestCase("yep", 100000004)]
public void GetSearchEngineOptionSetTest(string accountName, int expectedSearchEngine)
{
//Arrange
Mock<IOrganizationService> orgService = new Mock<IOrganizationService>();
orgService.Setup(org => org.Execute(new RetrieveAttributeRequest()))
.Returns(new RetrieveAttributeResponse() { Results = new ParameterCollection() });
SearchEngineChecker sut = new SearchEngineChecker();
//Act
var searchEngine = sut.GetSearchEngineOptionSet(accountName, orgService.Object);
//Assert
Assert.AreEqual(expectedSearchEngine, searchEngine);
}
}
}