public void souldReturnFacsetSecuritiesWhenAddProject() { _projects = new ProjectCollection(); var newProject = new ProjectTest.Builder() .WithName("Facset") .WithCode("ggn-001") .Build(); var expectedProject = new ProjectTest.Builder() .WithName("Facset-Securities") .WithCode("ggn-001") .Build(); _projects.Add(newProject); Project firsElement; using (var e = _projects.GetEnumerator()) { e.MoveNext(); firsElement = e.Current; } Assert.True(firsElement.Name.Equals(expectedProject.Name)); }
public void GetEnumeratorNullTest() { ProjectCollection target = new ProjectCollection(); IEnumerator actual; actual = target.GetEnumerator(); Assert.IsNull(actual); }
public void GetEnumeratorSelectedProjectsTest() { ProjectCollection target = new ProjectCollection(); Mock <IEnumerable> mockEnumerable = new Mock <IEnumerable>(); Mock <IEnumerator> mockEnumerator = new Mock <IEnumerator>(); IEnumerator expected = mockEnumerator.Instance; mockEnumerable.ImplementExpr(e => e.GetEnumerator(), expected); target.SelectedProjects = mockEnumerable.Instance; IEnumerator actual; actual = target.GetEnumerator(); Assert.AreEqual(expected, actual); }
public void GetEnumeratorSelectedProjectsTest() { ProjectCollection target = new ProjectCollection(); Mock <IEnumerable> mockEnumerable = new Mock <IEnumerable>(MockBehavior.Strict); Mock <IEnumerator> mockEnumerator = new Mock <IEnumerator>(MockBehavior.Strict); IEnumerator expected = mockEnumerator.Object; mockEnumerable.Setup(e => e.GetEnumerator()).Returns(expected); target.SelectedProjects = mockEnumerable.Object; IEnumerator actual; actual = target.GetEnumerator(); Assert.AreEqual(expected, actual); }