public void TemplateRepositoryTests_RetrieveTemplate_ShouldRetrieve() { #region Assemble DbHelpers.ClearDatabase(); TemplateRepository templateRepository = new TemplateRepository(DbHelpers.GetContextFactory()); ConnectionManager connectionManager = new ConnectionManager(@"(local)\SQLExpress", "Odin"); connectionManager.SetUseTrustedConnection(true); LogServiceFactory logServiceFactory = new LogServiceFactory("Odin"); OdinContextFactory OdinContextFactory = new OdinContextFactory(connectionManager, logServiceFactory); ItemObject template2 = new ItemObject(2); template2.TemplateId = "TempalteId2"; ItemObject template = new ItemObject(2); template.TemplateId = "TempalteId"; template.AccountingGroup = "AG"; template.CasepackHeight = "1"; template.CasepackLength = "2"; template.CasepackQty = "3"; template.CasepackWidth = "4"; template.CasepackWeight = "5"; template.Category = "c1"; template.Category2 = "c2"; template.Category3 = "c3"; template.Copyright = "copyright"; template.CostProfileGroup = "cpg"; template.DefaultActualCostUsd = "2"; template.DefaultActualCostCad = "5"; template.Duty = "4"; template.Gpc = "GPC"; template.Height = "99"; template.InnerpackHeight = "12"; template.InnerpackLength = "43"; template.InnerpackQuantity = "36"; template.InnerpackWidth = "12"; template.InnerpackWeight = "90"; template.ItemCategory = "IC"; template.ItemFamily = "IF"; template.ItemGroup = "IG"; template.Length = "4"; template.ListPriceCad = "4.22"; template.ListPriceUsd = "5.14"; template.ListPriceMxn = "8.45"; template.MetaDescription = "MD"; template.MfgSource = "MS"; template.Msrp = "9.09"; template.MsrpCad = "6.87"; template.MsrpMxn = "3.96"; template.PrintOnDemand = "P"; template.ProductFormat = "PF"; template.ProductGroup = "PG"; template.ProductLine = "PL"; template.ProductQty = "PQ"; template.PricingGroup = "PG"; template.PsStatus = "P"; template.SatCode = "SC"; template.Size = "Size"; template.TariffCode = "TC"; template.Udex = "Udex"; template.Weight = "23"; template.Width = "85"; template.EcommerceBullet1 = "EB1"; template.EcommerceBullet2 = "EB2"; template.EcommerceBullet3 = "EB3"; template.EcommerceBullet4 = "EB4"; template.EcommerceBullet5 = "EB5"; template.EcommerceComponents = "COM"; template.EcommerceCost = "66"; template.EcommerceExternalIdType = "EIT"; template.EcommerceItemHeight = "3"; template.EcommerceItemLength = "4"; template.EcommerceItemWeight = "5"; template.EcommerceItemWidth = "8"; template.EcommerceModelName = "MNAME"; template.EcommercePackageLength = "39"; template.EcommercePackageHeight = "65"; template.EcommercePackageWeight = "34"; template.EcommercePackageWidth = "82"; template.EcommercePageQty = "19"; template.EcommerceProductCategory = "PC"; template.EcommerceProductDescription = "PD"; template.EcommerceProductSubcategory = "PS"; template.EcommerceManufacturerName = "MANNAME"; template.EcommerceMsrp = "4.34"; template.EcommerceSize = "ESIZE"; #endregion // Assemble #region Act templateRepository.InsertTemplate(template2); templateRepository.InsertTemplate(template); ItemObject odinItemTemplates = templateRepository.RetrieveTemplate("TempalteId"); #endregion // Act #region Assert Assert.AreEqual(odinItemTemplates.TemplateId, "TempalteId"); Assert.AreEqual(odinItemTemplates.AccountingGroup, "AG"); Assert.AreEqual(odinItemTemplates.CasepackHeight, "1"); Assert.AreEqual(odinItemTemplates.CasepackLength, "2"); Assert.AreEqual(odinItemTemplates.CasepackQty, "3"); Assert.AreEqual(odinItemTemplates.CasepackWidth, "4"); Assert.AreEqual(odinItemTemplates.CasepackWeight, "5"); Assert.AreEqual(odinItemTemplates.Category, "c1"); Assert.AreEqual(odinItemTemplates.Category2, "c2"); Assert.AreEqual(odinItemTemplates.Category3, "c3"); Assert.AreEqual(odinItemTemplates.Copyright, "copyright"); Assert.AreEqual(odinItemTemplates.CostProfileGroup, "cpg"); Assert.AreEqual(odinItemTemplates.DefaultActualCostUsd, "2"); Assert.AreEqual(odinItemTemplates.DefaultActualCostCad, "5"); Assert.AreEqual(odinItemTemplates.Duty, "4"); Assert.AreEqual(odinItemTemplates.Gpc, "GPC"); Assert.AreEqual(odinItemTemplates.Height, "99"); Assert.AreEqual(odinItemTemplates.InnerpackHeight, "12"); Assert.AreEqual(odinItemTemplates.InnerpackLength, "43"); Assert.AreEqual(odinItemTemplates.InnerpackQuantity, "36"); Assert.AreEqual(odinItemTemplates.InnerpackWidth, "12"); Assert.AreEqual(odinItemTemplates.InnerpackWeight, "90"); Assert.AreEqual(odinItemTemplates.ItemCategory, "IC"); Assert.AreEqual(odinItemTemplates.ItemFamily, "IF"); Assert.AreEqual(odinItemTemplates.ItemGroup, "IG"); Assert.AreEqual(odinItemTemplates.Length, "4"); Assert.AreEqual(odinItemTemplates.ListPriceCad, "4.22"); Assert.AreEqual(odinItemTemplates.ListPriceUsd, "5.14"); Assert.AreEqual(odinItemTemplates.ListPriceMxn, "8.45"); Assert.AreEqual(odinItemTemplates.MetaDescription, "MD"); Assert.AreEqual(odinItemTemplates.MfgSource, "MS"); Assert.AreEqual(odinItemTemplates.Msrp, "9.09"); Assert.AreEqual(odinItemTemplates.MsrpCad, "6.87"); Assert.AreEqual(odinItemTemplates.MsrpMxn, "3.96"); Assert.AreEqual(odinItemTemplates.PrintOnDemand, "P"); Assert.AreEqual(odinItemTemplates.ProductFormat, "PF"); Assert.AreEqual(odinItemTemplates.ProductGroup, "PG"); Assert.AreEqual(odinItemTemplates.ProductLine, "PL"); Assert.AreEqual(odinItemTemplates.ProductQty, "PQ"); Assert.AreEqual(odinItemTemplates.PricingGroup, "PG"); Assert.AreEqual(odinItemTemplates.PsStatus, "P"); Assert.AreEqual(odinItemTemplates.SatCode, "SC"); Assert.AreEqual(odinItemTemplates.Size, "Size"); Assert.AreEqual(odinItemTemplates.TariffCode, "TC"); Assert.AreEqual(odinItemTemplates.Udex, "Udex"); Assert.AreEqual(odinItemTemplates.Weight, "23"); Assert.AreEqual(odinItemTemplates.Width, "85"); Assert.AreEqual(odinItemTemplates.EcommerceBullet1, "EB1"); Assert.AreEqual(odinItemTemplates.EcommerceBullet2, "EB2"); Assert.AreEqual(odinItemTemplates.EcommerceBullet3, "EB3"); Assert.AreEqual(odinItemTemplates.EcommerceBullet4, "EB4"); Assert.AreEqual(odinItemTemplates.EcommerceBullet5, "EB5"); Assert.AreEqual(odinItemTemplates.EcommerceComponents, "COM"); Assert.AreEqual(odinItemTemplates.EcommerceCost, "66"); Assert.AreEqual(odinItemTemplates.EcommerceExternalIdType, "EIT"); Assert.AreEqual(odinItemTemplates.EcommerceItemHeight, "3"); Assert.AreEqual(odinItemTemplates.EcommerceItemLength, "4"); Assert.AreEqual(odinItemTemplates.EcommerceItemWeight, "5"); Assert.AreEqual(odinItemTemplates.EcommerceItemWidth, "8"); Assert.AreEqual(odinItemTemplates.EcommerceModelName, "MNAME"); Assert.AreEqual(odinItemTemplates.EcommercePackageLength, "39"); Assert.AreEqual(odinItemTemplates.EcommercePackageHeight, "65"); Assert.AreEqual(odinItemTemplates.EcommercePackageWeight, "34"); Assert.AreEqual(odinItemTemplates.EcommercePackageWidth, "82"); Assert.AreEqual(odinItemTemplates.EcommercePageQty, "19"); Assert.AreEqual(odinItemTemplates.EcommerceProductCategory, "PC"); Assert.AreEqual(odinItemTemplates.EcommerceProductDescription, "PD"); Assert.AreEqual(odinItemTemplates.EcommerceProductSubcategory, "PS"); Assert.AreEqual(odinItemTemplates.EcommerceManufacturerName, "MANNAME"); Assert.AreEqual(odinItemTemplates.EcommerceMsrp, "4.34"); Assert.AreEqual(odinItemTemplates.EcommerceSize, "ESIZE"); #endregion // Assert }