Ejemplo n.º 1
0
 public static DeclareSendMessageRequest CreateDeclareSendMessageRequest(Declaration declaration)
 {
     return(new DeclareSendMessageRequest
     {
         Declaration = DomainStubFactory.CreateDeclaration(declaration.RetrivedBadge)
     });
 }
Ejemplo n.º 2
0
        public override void Given()
        {
            base.Given();
            this.Declaration = DomainStubFactory.CreateDeclaration(new Badge {
                Nbr = "1265-1265-1265"
            });

            ExpectedResult = DomainStubFactory.CreateDeclareSendMessageRequest(this.Declaration);
        }
Ejemplo n.º 3
0
        public void CanAddMobileToOwner()
        {
            var owner = DomainStubFactory.CreateOwner();

            owner.Mobiles.Add(2, "0495678990");
            //Act
            _session.Save(
                owner
                );

            //Assert
            var result = Queries.RetrieveOwner(this._session, DomainStubFactory.CreateOwner()).First();

            Assert.AreEqual(3, result.Mobiles.Count);
        }
Ejemplo n.º 4
0
        public void CanCreateOwner()
        {
            //Act
            _session.Save(
                DomainStubFactory.CreateOwner()
                );

            //Assert
            var memOwner = DomainStubFactory.CreateOwner();
            IQueryable <Owner> expected = Queries.RetrieveOwner(this._session, memOwner);

            var ow = expected.First();

            Assert.AreEqual(ow.EmailAddresses.First(), memOwner.EmailAddresses.First());
        }
Ejemplo n.º 5
0
        public void CanEditOwnerMobile()
        {
            string newMobile = "04939292929";
            var    owner     = DomainStubFactory.CreateOwner();

            owner.Mobiles[0] = newMobile;
            //Act
            _session.Save(
                owner
                );

            //Assert
            var result = Queries.RetrieveOwner(this._session, DomainStubFactory.CreateOwner()).First();

            Assert.AreEqual(newMobile, result.Mobiles[0]);
        }
Ejemplo n.º 6
0
        public void CanDeleteOwner()
        {
            //Arrange
            var owner = DomainStubFactory.CreateOwner();

            _session.Save(owner);

            //Act
            _session.Delete(owner);

            var memOwner = DomainStubFactory.CreateOwner();
            IQueryable <Owner> expected = Queries.RetrieveOwner(this._session, memOwner);

            var ow = expected.FirstOrDefault();

            Assert.IsNull(ow);
        }
Ejemplo n.º 7
0
        public void CanAddBadgeToOwner()
        {
            //Act
            var owner = DomainStubFactory.CreateOwner();

            owner.AddBadge(new Badge()
            {
                Nbr = "GHJ-IOP-123"
            });
            _session.Save(
                owner
                );


            //Assert
            var result = Queries.RetrieveOwner(this._session, owner);

            Assert.AreEqual(3, result.First().Badges.Count());
            Assert.AreEqual("GHJIOP123", new List <Badge>(result.First().Badges)[2].Nbr);
        }
Ejemplo n.º 8
0
 public override void When()
 {
     base.When();
     Owner = DomainStubFactory.CreateOwner();
     Owner = MapperService.MapToOwner(Owner, Request);
 }