public override void Given() { base.Given(); this.BadgeToBeActivated = new Badge { Nbr = "333333333" }; Owner = DomainStubFactory.CreateOwner(); Subject = new ActivateController(this.ApplicationFacade); MockedSessionService.Stub(x => x["badgeNbr"]).Return(new List <Badge>(Owner.Badges)[0].Nbr); MockedSessionService.Stub(x => x["owner"]).Return(Owner); MockedBadgeRepository.Stub(x => x.GetBy(n => n.Nbr == new List <Badge>(Owner.Badges)[0].Nbr)).IgnoreArguments().Return(this.BadgeToBeActivated); MockedMapperService.Stub(x => x.MapToOwner(Owner, new ActivateMobileRequest())).IgnoreArguments().Return(Owner); MockedDistributorService.Stub(x => x.SendActivationConfirmation(this.BadgeToBeActivated)); }
public override void Given() { base.Given(); Subject = new ActivateController(this.ApplicationFacade); _request = new ActivateIndexRequest { Gender = Gender.Male, Email = "*****@*****.**", Email2 = "*****@*****.**", //todo:remove magic const ConfirmEmail = "*****@*****.**", Password = "******", ConfirmPassword = "******", }; _owner = DomainStubFactory.CreateOwner(); MockedMapperService.Stub(n => n.MapToOwner(_owner, _request)).Return(_owner).IgnoreArguments(); MockedSessionService.Stub(n => n["badgeNbr"]).Return(new List <Badge>(DomainStubFactory.CreateOwner().Badges)[0].Nbr); string salt; MockedSecurityService.Stub(n => n.Hash(_request.Password, out salt)).Return("hasedPassword").OutRef("theSalt"); }