public void Test()
        {
            Matcher matcher = new Matcher(new User { SniHeadID = "1", SniHead = new SniHead {Title = "Test"}} as IUser, // macth is done on SniHeadID
                                          new User {SniHeadID = "1", SniHead = new SniHead {Title = "Test"}} as IUser);

            Assert.That(matcher.GetResultsAsHtmlTable(),  Is.StringStarting("<table><tr><td class='matchTableFirstCell'><td class='matchTableContentCell'>Test</td>"));
        }
Ejemplo n.º 2
0
        public void SuccesFullMatchExactlyOneSearchWord()
        {
            var user = new User() { SearchWords = "investmentbolag" };
            var user2 = new User() { SearchWords = "investmentbolag" };

            var matchResult = new Matcher(user, user2);
            Assert.That(matchResult.SearchWordsMatchResult.IsMatch(), Is.EqualTo(true));
        }
Ejemplo n.º 3
0
        public void EmptyStringSearchWordsShouldNotMatch()
        {
            var user = new User() { SearchWords = "köra truck,mata djur" };
            var user2 = new User() { SearchWords = "" };

            var matchResult = new Matcher(user, user2);
            Assert.That(matchResult.SearchWordsMatchResult.IsMatch(), Is.EqualTo(false));
        }
Ejemplo n.º 4
0
        public void Match_UserTypes_ShouldFail()
        {
            var user = new User() { UserType = 0, UserTypesNeeded = "1,5" };
            var user2 = new User() { UserType = 0 };

            var matcher = new Matcher(user, user2);

            Assert.That(matcher.UserTypeMatch.IsMatch(), Is.EqualTo(false));
        }
Ejemplo n.º 5
0
        public void GetMatchCount_CountReturned_ShouldBe2()
        {
            var user = new User() { UserType = 0, UserTypesNeeded = "1,5", SniNo="A"};
            var user2 = new User() { UserType = 5, SniNo = "A" };

            var matchResult = new Matcher(user, user2);

            Assert.That(matchResult.GetMatchCount(), Is.EqualTo(2));
        }
Ejemplo n.º 6
0
        public void MatchUserTypesWithOutput()
        {
            var user = new User() { UserTypesNeeded = UserTypes.Innovator.ToString() };
            var user2 = new User() { UserType = (int)UserTypes.Innovator };

            var matcher = new Matcher(user, user2);

            string actualFirstValue = matcher.UserTypeMatch.FirstValue;
            string expectedFirstValue = UserTypes.Innovator.GetTitle();
            Assert.That(actualFirstValue, Is.EqualTo(expectedFirstValue));

            string actualSecondValue = matcher.UserTypeMatch.SecondValue;
            string expectedSecondValue = UserTypes.Innovator.GetTitle();
            Assert.That(actualSecondValue, Is.EqualTo(expectedSecondValue));

            Assert.That(matcher.UserTypeMatch.IsMatch(), Is.EqualTo(true) );
        }
Ejemplo n.º 7
0
        public void SuccesFullMatchSearchWords()
        {
            var user = new User() { SearchWords = "kossa,apa" };
            var user2 = new User() { SearchWords = "kossa" };

            var matchResult = new Matcher(user, user2);
            Assert.That(matchResult.SearchWordsMatchResult.IsMatch(), Is.EqualTo(true));
        }
Ejemplo n.º 8
0
        public void UnSuccesFullMatchSniHeadTest()
        {
            var user = new User() { SniHeadID = "A", SniHead = new SniHead() { Title = "IT & Kommunikation" } };
            var user2 = new User() { SniHeadID = "B", SniHead = new SniHead() { Title = "tes" } };

            var matchResult = new Matcher(user, user2);
            Assert.That(matchResult.SniHeadMatch.IsMatch(), Is.EqualTo(false));
        }
Ejemplo n.º 9
0
        public void UnSuccesFullMatchSniNo()
        {
            var user = new User() { SniNo = "1", SniItem = new SniItem() { Title = "test" } };
            var user2 = new User() { SniNo = "2", SniItem = new SniItem() { Title = "test2" } };

            var matchResult = new Matcher(user, user2);
            Assert.That(matchResult.SniNoMatch.IsMatch(), Is.EqualTo(false));
        }
Ejemplo n.º 10
0
        public void UnSuccesFullMatchSearchWordsCompetenceSameCompetence()
        {
            var user = new User() { SearchWordsCompetence = "köra truck,mata djur", SearchWordsCompetenceNeeded = "laga mat"};
            var user2 = new User() { SearchWordsCompetenceNeeded = "äta barn", SearchWordsCompetence = "mata djur" };

            var matchResult = new Matcher(user, user2);
            Assert.That(matchResult.SearchWordsCompetenceMatch.ToString(), Is.EqualTo("False"));
        }
Ejemplo n.º 11
0
        public void SuccesFullMatchWithValue()
        {
            const string actual = "investmentbolag, socialt ansvarstagande, samhällsutveckling, crowdsourcing";
            var user = new User() { SearchWords = "investmentbolag, socialt ansvarstagande, samhällsutveckling, crowdsourcing" };
            var user2 = new User() { SearchWords = "programmering, iphone" };

            var matchResult = new Matcher(user, user2);
            Assert.That(matchResult.SearchWordsMatchResult.IsMatch(), Is.EqualTo(false));
            Assert.That(matchResult.SearchWordsMatchResult.FirstValue, Is.EqualTo(actual));
        }
Ejemplo n.º 12
0
        public void SuccesFullMatchUserTypes()
        {
            var user = new User { UserType = (int)UserTypes.Businessman, UserTypesNeeded = "1,4" };
            var user2 = new User {UserType = (int)UserTypes.Retiring};

            var matchResult = new Matcher(user, user2);

            Assert.That(matchResult.UserTypeMatch.IsMatch(), Is.EqualTo(true));
        }
Ejemplo n.º 13
0
        public void SuccesFullMatchSniNo()
        {
            var user = new User() { SniNo = "1", SniItem = new SniItem() {Title= "test"} };
            var user2 = new User() { SniNo = "1", SniItem = new SniItem() { Title = "test" } };

            var matcher = new Matcher(user, user2);
            Assert.That(matcher.SniNoMatch.IsMatch(), Is.EqualTo(true));
        }
Ejemplo n.º 14
0
        public void SuccesFullMatchSniHeadTest()
        {
            var user = new User() {SniHeadID = "A", SniHead = new SniHead(){Title = "IT & Kommunikation"}};
            var user2 = new User() { SniHeadID = "A", SniHead = new SniHead(){Title = "IT & Kommunikation"}};

            var matcher = new Matcher(user as IUser, user2 as IUser);
            Assert.That(matcher.SniHeadMatch.IsMatch(), Is.EqualTo(true));
        }