Exemplo n.º 1
0
        public RevenueObjectRepositoryTests()
        {
            var optionsBuilder = new DbContextOptionsBuilder();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString("N"));

            _context = new RevenueObjectContext(optionsBuilder);

            _context.RevenueObject.Add(new Models.V1.RevenueObject
            {
                Id = Id,
                BeginEffectiveDate = _newestEffectiveDate,
                EffectiveStatus    = "A",
                TransactionId      = 0,
                Pin              = PinWithSitus,
                UnformattedPin   = "UnformattedPin",
                Ain              = "Ain",
                GeoCd            = "GeoCd",
                ClassCd          = SysTypeClassCdId,
                AreaCd           = "AreaCd",
                CountyCd         = "CountyCd",
                CensusTract      = "Track",
                CensusBlock      = "Block",
                XCoordinate      = "XCoordinate",
                YCoordinate      = "YCoordinate",
                ZCoordinate      = "ZCoordinate",
                RightEstate      = 0,
                RightType        = 0,
                RightDescription = 0,
                Type             = RevObjTypeParcel,
                SubType          = 0
            });

            _context.RevenueObject.Add(new Models.V1.RevenueObject
            {
                Id = Id,
                BeginEffectiveDate = _olderEffectiveDate,
                EffectiveStatus    = "A",
                TransactionId      = 0,
                Pin              = "pin",
                UnformattedPin   = "UnformattedPin",
                Ain              = "Ain",
                GeoCd            = "GeoCd",
                ClassCd          = SysTypeClassCdId,
                AreaCd           = "AreaCd",
                CountyCd         = "CountyCd",
                CensusTract      = "Track",
                CensusBlock      = "Block",
                XCoordinate      = "XCoordinate",
                YCoordinate      = "YCoordinate",
                ZCoordinate      = "ZCoordinate",
                RightEstate      = 0,
                RightType        = 0,
                RightDescription = 0,
                Type             = RevObjTypeParcel,
                SubType          = 0
            });
            _context.RevenueObject.Add(new Models.V1.RevenueObject
            {
                Id = Id,
                BeginEffectiveDate = _oldestEffectiveDate,
                EffectiveStatus    = "A",
                TransactionId      = 0,
                Pin              = "pin",
                UnformattedPin   = "UnformattedPin",
                Ain              = "Ain",
                GeoCd            = "GeoCd",
                ClassCd          = SysTypeClassCdId,
                AreaCd           = "AreaCd",
                CountyCd         = "CountyCd",
                CensusTract      = "Track",
                CensusBlock      = "Block",
                XCoordinate      = "XCoordinate",
                YCoordinate      = "YCoordinate",
                ZCoordinate      = "ZCoordinate",
                RightEstate      = 0,
                RightType        = 0,
                RightDescription = 0,
                Type             = RevObjTypeParcel,
                SubType          = 0
            });
            _context.RevenueObject.Add(new Models.V1.RevenueObject()
            {
                Id = RelatedRevenueObjectId,
                BeginEffectiveDate = _newestEffectiveDate,
                EffectiveStatus    = "A",
                Pin     = RelatedRevenueObjectPin,
                ClassCd = SysTypeClassCdId
            });

            _context.SysTypeCat.Add(new SysTypeCat
            {
                Id = SysTypeCatId,
                BeginEffectiveDate = _newestEffectiveDate,
                ShortDescription   = SysTypeCatShortDescription,
                EffectiveStatus    = "A"
            });
            _context.SysTypeCat.Add(new SysTypeCat
            {
                Id = SysTypeCatId,
                BeginEffectiveDate = _olderEffectiveDate,
                ShortDescription   = "older SysTypeCat description",
                EffectiveStatus    = "A"
            });
            _context.SysTypeCat.Add(new SysTypeCat
            {
                Id = SysTypeCatId,
                BeginEffectiveDate = _oldestEffectiveDate,
                ShortDescription   = "oldest SysTypeCat description",
                EffectiveStatus    = "A"
            });

            _context.SysType.Add(new SysType
            {
                Id = SysTypeId,
                EffectiveStatus    = "A",
                BeginEffectiveDate = _newestEffectiveDate,
                ShortDescription   = SysTypeShortDescription,
                SysTypeCatId       = SysTypeCatId
            });
            _context.SysType.Add(new SysType
            {
                Id = SysTypeId,
                EffectiveStatus    = "A",
                BeginEffectiveDate = _olderEffectiveDate,
                ShortDescription   = "older SysType description",
                SysTypeCatId       = SysTypeCatId
            });
            _context.SysType.Add(new SysType
            {
                Id = SysTypeId,
                EffectiveStatus    = "A",
                BeginEffectiveDate = _oldestEffectiveDate,
                ShortDescription   = "oldest SysType description",
                SysTypeCatId       = SysTypeCatId
            });
            _context.SysType.Add(new SysType
            {
                Id = RevObjTypeParcel,
                EffectiveStatus    = "A",
                BeginEffectiveDate = _oldestEffectiveDate,
                ShortDescription   = SysTypeShortDescrParcel,
                SysTypeCatId       = SysTypeCatId
            });
            _context.SysType.Add(new SysType()
            {
                Id                 = SysTypeClassCdId,
                Description        = SysTypeClassCdDescr,
                EffectiveStatus    = "A",
                BeginEffectiveDate = _newestEffectiveDate
            });

            _context.TAG.Add(new TAG
            {
                Id = TagId,
                BeginEffectiveYear = NewestEffectiveYear,
                EffectiveStatus    = "A",
                Description        = TagDescription
            });
            _context.TAG.Add(new TAG
            {
                Id = TagId,
                BeginEffectiveYear = OlderEffectiveYear,
                EffectiveStatus    = "A",
                Description        = "older TAG description"
            });
            _context.TAG.Add(new TAG
            {
                Id = TagId,
                BeginEffectiveYear = OldestEffectiveYear,
                EffectiveStatus    = "A",
                Description        = "oldest TAG description"
            });
            _context.TAGRole.Add(new TAGRole
            {
                Id = 133,
                BeginEffectiveDate = _newestEffectiveDate,
                EffectiveStatus    = "A",
                ObjectType         = SysTypeId,
                ObjectId           = Id,
                TAGId = TagId
            });
            _context.TAGRole.Add(new TAGRole
            {
                Id = 133,
                BeginEffectiveDate = _olderEffectiveDate,
                EffectiveStatus    = "A",
                ObjectType         = SysTypeId,
                ObjectId           = Id,
                TAGId = OlderTagId
            });
            _context.TAGRole.Add(new TAGRole
            {
                Id = 133,
                BeginEffectiveDate = _oldestEffectiveDate,
                EffectiveStatus    = "A",
                ObjectType         = SysTypeId,
                ObjectId           = Id,
                TAGId = OldestTagId
            });
            _context.TAGRole.Add(new TAGRole
            {
                Id = 133,
                BeginEffectiveDate = new DateTime(2017, 1, 1),
                EffectiveStatus    = "A",
                ObjectType         = SysTypeId,
                ObjectId           = Id,
                TAGId = TagId
            });

            _context.SitusAddress.Add(new SitusAddress()
            {
                Id = SitusAddressId,
                BeginEffectiveDate = _newestEffectiveDate,
                EffectiveStatus    = "A",
                FreeFormAddress    = _situsAddress.FreeFormAddress,
                City       = _situsAddress.City,
                StateCode  = _situsAddress.StateCode,
                PostalCode = _situsAddress.PostalCode
            });
            _context.SitusAddressRole.Add(new SitusAddressRole()
            {
                Id = Id,
                BeginEffectiveDate = _newestEffectiveDate,
                EffectiveStatus    = "A",
                ObjectId           = Id,
                ObjectType         = SysTypeId,
                SitusAddressId     = SitusAddressId,
                PrimeAddr          = 1
            });

            _context.DescriptionHeader.Add(new DescriptionHeader()
            {
                Id = DescHeaderId,
                BeginEffectiveDate = _newestEffectiveDate,
                DisplayDescription = DescHeaderDescription,
                EffectiveStatus    = "A",
                RevenueObjectId    = Id
            });
            _context.DescriptionHeader.Add(new DescriptionHeader()
            {
                Id = DescHeaderId,
                BeginEffectiveDate = _olderEffectiveDate,
                DisplayDescription = "baloney",
                EffectiveStatus    = "I",
                RevenueObjectId    = Id
            });

            _context.RelatedRevenueObject.Add(new RelatedRevenueObject()
            {
                Id = 23,
                EffectiveStatus    = "A",
                BeginEffectiveDate = _newestEffectiveDate,
                RevenueObject1Id   = Id,
                RevenueObject2Id   = RelatedRevenueObjectId
            });

            _context.ClassCodeMap.Add(new ClassCodeMap()
            {
                Id        = Id,
                RollType  = RelatedRevenueObjectRollType,
                ClassCode = SysTypeClassCdId
            });

            _context.SaveChanges();
        }
Exemplo n.º 2
0
 public RevenueObjectRepository(RevenueObjectContext revenueObjectContext)
 {
     _revenueObjectContext = revenueObjectContext;
 }
 public MarketAndRestrictedValueRepository(RevenueObjectContext revenueObjectContext)
 {
     _revenueObjectContext = revenueObjectContext;
 }