public void HasGetSet()
 {
     const int value = 6;
     var entity = new Affiliation { EstablishmentId = value };
     entity.ShouldNotBeNull();
     entity.EstablishmentId.ShouldEqual(value);
 }
 public void HasGetSet()
 {
     const string value = "text";
     var entity = new Affiliation { JobTitles = value };
     entity.ShouldNotBeNull();
     entity.JobTitles.ShouldEqual(value);
 }
 public void HasGetSet()
 {
     const int value = 14;
     var entity = new Affiliation { PersonId = value };
     entity.ShouldNotBeNull();
     entity.PersonId.ShouldEqual(value);
 }
            public void CreatesAffiliation_WithEstablishmentId()
            {
                Affiliation outEntity       = null;
                const int   personId        = 13;
                const int   establishmentId = 13;
                var         person          = new Person
                {
                    RevisionId = personId,
                };
                var command = new CreateAffiliationCommand
                {
                    PersonId        = personId,
                    EstablishmentId = establishmentId,
                };
                var entities = new Mock <ICommandEntities>(MockBehavior.Strict).Initialize();

                entities.Setup(m => m.Get <Person>()).Returns(new[] { person }.AsQueryable);
                entities.Setup(m => m.Create(It.Is(AffiliationBasedOn(command))))
                .Callback((Entity entity) => outEntity = (Affiliation)entity);
                var handler = new CreateAffiliationHandler(entities.Object);

                handler.Handle(command);

                outEntity.ShouldNotBeNull();
                outEntity.EstablishmentId.ShouldEqual(command.EstablishmentId);
            }
            public void CreatesAffiliation_WithNotIsDefault_WhenPersonAlreadyHasDefaultAffiliation()
            {
                Affiliation outEntity = null;
                const int   personId  = 13;
                var         person    = new Person
                {
                    RevisionId   = personId,
                    Affiliations = new Collection <Affiliation>
                    {
                        new Affiliation {
                            IsDefault = true,
                        }
                    }
                };
                var command = new CreateAffiliationCommand
                {
                    PersonId = personId,
                };
                var entities = new Mock <ICommandEntities>(MockBehavior.Strict).Initialize();

                entities.Setup(m => m.Get <Person>()).Returns(new[] { person }.AsQueryable);
                entities.Setup(m => m.Create(It.Is(AffiliationBasedOn(command))))
                .Callback((Entity entity) => outEntity = (Affiliation)entity);
                var handler = new CreateAffiliationHandler(entities.Object);

                handler.Handle(command);

                outEntity.ShouldNotBeNull();
                outEntity.IsDefault.ShouldBeFalse();
            }
            public void HasGetSet()
            {
                const string value  = "text";
                var          entity = new Affiliation {
                    JobTitles = value
                };

                entity.ShouldNotBeNull();
                entity.JobTitles.ShouldEqual(value);
            }
            public void HasGetSet()
            {
                const int value  = 6;
                var       entity = new Affiliation {
                    EstablishmentId = value
                };

                entity.ShouldNotBeNull();
                entity.EstablishmentId.ShouldEqual(value);
            }
            public void HasGetSet()
            {
                const bool value  = true;
                var        entity = new Affiliation {
                    IsClaimingInternationalOffice = value
                };

                entity.ShouldNotBeNull();
                entity.IsClaimingInternationalOffice.ShouldEqual(value);
            }
            public void HasGetSet()
            {
                const int value  = 14;
                var       entity = new Affiliation {
                    PersonId = value
                };

                entity.ShouldNotBeNull();
                entity.PersonId.ShouldEqual(value);
            }
            public void HasGetSet()
            {
                const bool value  = true;
                var        entity = new Affiliation {
                    IsClaimingStudent = value
                };

                entity.ShouldNotBeNull();
                entity.IsClaimingStudent.ShouldEqual(value);
            }
            public void HasGetSet()
            {
                const bool value  = true;
                var        entity = new Affiliation {
                    IsAcknowledged = value
                };

                entity.ShouldNotBeNull();
                entity.IsAcknowledged.ShouldEqual(value);
            }
Exemple #12
0
 public void HasGetSet()
 {
     const bool value = true;
     var entity = new Affiliation { IsAcknowledged = value };
     entity.ShouldNotBeNull();
     entity.IsAcknowledged.ShouldEqual(value);
 }
Exemple #13
0
 public void HasGetSet()
 {
     const bool value = true;
     var entity = new Affiliation { IsClaimingInternationalOffice = value };
     entity.ShouldNotBeNull();
     entity.IsClaimingInternationalOffice.ShouldEqual(value);
 }
Exemple #14
0
 public void HasGetSet()
 {
     const bool value = true;
     var entity = new Affiliation { IsClaimingStudent = value };
     entity.ShouldNotBeNull();
     entity.IsClaimingStudent.ShouldEqual(value);
 }