Example #1
0
        public Observation(
            string key,
            User createdByUser,
            string title,
            DateTime createdOn,
            DateTime observedOn,
            string latitude,
            string longitude,
            string address,
            bool anonymiseLocation,
            string category,
            UserProject userProject,
            IEnumerable<Project> projects,
            IEnumerable<Tuple<MediaResource, string, string, bool>> media
            )
            : base(key,
            createdByUser,
            createdOn,
            observedOn,
            latitude,
            longitude,
            anonymiseLocation,
            category,
            userProject,
            projects)
        {
            InitMembers();

            SetObservationDetails(
                title,
                address,
                media);

            ApplyEvent(new SightingCreatedEvent(this, createdByUser, this, projects));
        }
Example #2
0
 public Record(
     string key,
     User createdByUser,
     DateTime createdOn,
     DateTime observedOn,
     string latitude,
     string longitude,
     bool anonymiseLocation,
     string category,
     UserProject userProject,
     IEnumerable <Project> projects
     )
     : base(
         key,
         createdByUser,
         createdOn,
         observedOn,
         latitude,
         longitude,
         anonymiseLocation,
         category,
         userProject,
         projects)
 {
     ApplyEvent(new SightingCreatedEvent(this, createdByUser, this, projects));
 }
Example #3
0
        protected Sighting(
            string key,
            User createdByUser,
            DateTime createdOn,
            DateTime observedOn,
            string latitude,
            string longitude,
            bool anonymiseLocation,
            string category,
            UserProject userProject,
            IEnumerable <Project> projects)
            : base()
        {
            Check.RequireNotNull(createdByUser, "createdByUser");
            Check.RequireNotNull(userProject, "userProject");
            Check.RequireNotNull(projects, "projects");

            InitMembers();

            Key       = key;
            User      = createdByUser;
            CreatedOn = createdOn;

            _sightingGroups.Add(new SightingGroup(userProject, createdByUser, createdOn));

            SetSightingDetails(
                createdByUser,
                createdOn,
                observedOn,
                latitude,
                longitude,
                anonymiseLocation,
                category,
                projects);
        }
        public void UserProject_Constructor()
        {
            var createdDateTime = DateTime.UtcNow;

            var testTeam = new UserProject(
                FakeObjects.TestUserWithId(),
                createdDateTime
                );

            Assert.AreEqual(testTeam.Name, "User Group");
            Assert.AreEqual(testTeam.CreatedDateTime, createdDateTime);
        }
Example #5
0
        public Observation(
            string key,
            User createdByUser,
            string title,
            DateTime createdOn,
            DateTime observedOn,
            string latitude,
            string longitude,
            string address,
            bool anonymiseLocation,
            string category,
            UserProject userProject,
            IEnumerable <Project> projects,
            IEnumerable <Tuple <MediaResource, string, string, bool> > media
            )
            : base(
                key,
                createdByUser,
                createdOn,
                observedOn,
                latitude,
                longitude,
                anonymiseLocation,
                category,
                userProject,
                projects
                )
        {
            InitMembers();

            SetObservationDetails(
                title,
                address,
                media);

            ApplyEvent(new SightingCreatedEvent(this, createdByUser, this, projects));
        }
Example #6
0
        public static UserProject TestUserProjectWithId(string id)
        {
            var userProject = new UserProject(
                TestUserWithId(),
                DateTime.UtcNow
                );

            ((IAssignableId)userProject).SetIdTo("userprojects", id);

            return userProject;
        }