public void CheckSimpleBuilder_UserNameMisspelled() { string ownerName = "Jon Mooree"; RiskStatus status = RiskStatus.Open; var builder = new Search_SimpleBuilder(listOfRisks); builder.GetListOfRisksWithOwnerName(ownerName); builder.GetListOfRisksWithDifferentStatus(status); var result = builder.Builded_Search(); Assert.True(result.Count == 0); }
public void CheckSimpleBuilder_WithoutTitle() { string ownerName = "Person 5"; RiskStatus status = RiskStatus.Open; var builder = new Search_SimpleBuilder(listOfRisks); builder.GetListOfRisksWithOwnerName(ownerName); builder.GetListOfRisksWithDifferentStatus(status); var result = builder.Builded_Search(); Assert.True(result.Count == 1); Assert.True(result[0].Owner.Name == ownerName); Assert.True(result[0].Status != RiskStatus.Open); }
public void CheckSimpleBuilder_UserName_KeySensitive() { string ownerName = "Person 5"; var builder = new Search_SimpleBuilder(listOfRisks); builder.GetListOfRisksWithOwnerName(ownerName); var result = builder.Builded_Search(); Assert.True(result.Count == 3); Assert.True(result[0].Owner.Name.ToLower() == ownerName.ToLower()); Assert.True(result[1].Owner.Name.ToLower() == ownerName.ToLower()); Assert.True(result[2].Owner.Name.ToLower() == ownerName.ToLower()); }
public void CheckSimpleBuilder_AllMethods() { RiskStatus notStatus = RiskStatus.Open; string title = "fire"; string ownerName = "Person 5"; var builder = new Search_SimpleBuilder(listOfRisks); builder.GetListOfRisksWithOwnerName(ownerName); builder.GetListOfRisksWithTitleContains(title); builder.GetListOfRisksWithDifferentStatus(notStatus); var result = builder.Builded_Search(); Assert.True(result.Count == 1); Assert.True(result[0].Owner.Name == ownerName); Assert.True(result[0].Title.Contains(title)); Assert.True(result[0].Status != RiskStatus.Open); }
public void CheckSimpleBuilder_WitoutStatus() { string ownerName = "Person 5"; string title = "fire"; var builder = new Search_SimpleBuilder(listOfRisks); builder.GetListOfRisksWithOwnerName(ownerName); builder.GetListOfRisksWithTitleContains(title); var result = builder.Builded_Search(); Assert.True(result.Count == 3); Assert.True(result[0].Owner.Name == ownerName); Assert.True(result[1].Owner.Name == ownerName); Assert.True(result[2].Owner.Name == ownerName); Assert.True(result[0].Title.Contains(title, System.StringComparison.InvariantCultureIgnoreCase)); Assert.True(result[1].Title.Contains(title, System.StringComparison.InvariantCultureIgnoreCase)); Assert.True(result[2].Title.Contains(title, System.StringComparison.InvariantCultureIgnoreCase)); }