Ejemplo n.º 1
0
        public void GetMembershipIfValidPsr()
        {
            // Arrange
            var psr = 10000005;

            var expected = new EF_Spike.Membership.Model.Membership
            {
                Psrnumber            = 10000005,
                MembershipReference  = 1,
                SectionNumber        = 0,
                LevyTagTypeReference = 2,
                EffectiveDate        = Convert.ToDateTime("1996-03-31T00:00:00"),
                EndDate             = null,
                EndEventReference   = null,
                AgeProfiling50to59  = null,
                AgeProfiling60Plus  = null,
                StartEventReference = 5
            };

            var tblMembership = AutoMapper.Mapper.Map <TblMembership>(expected);

            registryContext.Add(tblMembership);

            // Act
            var result = sut.Get(psr);

            var resolvedResult = resolver.GetOkResult(expected, result);

            // Assert
            Assert.True(resolvedResult.isOkResult);
            Assert.Equal(resolvedResult.expected, resolvedResult.result);
        }