Beispiel #1
0
        public void GetProjectionResults_WithSpaces_Test()
        {
            string expected = "The Long Run Leagues";
            string actual   = "Not Set";

            List <ProjectionSnapshotProperty> properties = new List <ProjectionSnapshotProperty>();

            properties.Add(ProjectionSnapshotProperty.Create <string>("Title", "Mr.", 0));
            properties.Add(ProjectionSnapshotProperty.Create <string>("Title", "Ms.", 1));
            properties.Add(ProjectionSnapshotProperty.Create <string>("Title", "Mr.", 2));
            properties.Add(ProjectionSnapshotProperty.Create <string>("Forename", "Duncan", 0));
            properties.Add(ProjectionSnapshotProperty.Create <string>("Surname", "Jones", 0));
            properties.Add(ProjectionSnapshotProperty.Create <string>("Domain", expected, 0));

            IEnumerable <object> asObjects = Projection.GetProjectionResults(properties);
            dynamic first = asObjects.FirstOrDefault();

            actual = first.Domain;

            Assert.AreEqual(expected, actual);
        }
Beispiel #2
0
        public void GetProjectionResults_Test()
        {
            int expected = 3;
            int actual   = 0;


            List <ProjectionSnapshotProperty> properties = new List <ProjectionSnapshotProperty>();

            properties.Add(ProjectionSnapshotProperty.Create <string>("Title", "Mr.", 0));
            properties.Add(ProjectionSnapshotProperty.Create <string>("Title", "Ms.", 1));
            properties.Add(ProjectionSnapshotProperty.Create <string>("Title", "Mr.", 2));
            properties.Add(ProjectionSnapshotProperty.Create <string>("Forename", "Duncan", 0));
            properties.Add(ProjectionSnapshotProperty.Create <string>("Surname", "Jones", 0));
            properties.Add(ProjectionSnapshotProperty.Create <double>("Salary", 34290D, 2));

            IEnumerable <object> asObjects = Projection.GetProjectionResults(properties);

            actual = asObjects.Count();

            Assert.AreEqual(expected, actual);
        }