コード例 #1
0
ファイル: DomainStubFactory.cs プロジェクト: wshcdr/multimvc
 public static DeclareSendMessageRequest CreateDeclareSendMessageRequest(Declaration declaration)
 {
     return(new DeclareSendMessageRequest
     {
         Declaration = DomainStubFactory.CreateDeclaration(declaration.RetrivedBadge)
     });
 }
コード例 #2
0
        public override void Given()
        {
            base.Given();
            this.Declaration = DomainStubFactory.CreateDeclaration(new Badge {
                Nbr = "1265-1265-1265"
            });

            ExpectedResult = DomainStubFactory.CreateDeclareSendMessageRequest(this.Declaration);
        }
コード例 #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);
        }
コード例 #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());
        }
コード例 #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]);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #8
0
 public override void When()
 {
     base.When();
     Owner = DomainStubFactory.CreateOwner();
     Owner = MapperService.MapToOwner(Owner, Request);
 }