public void CanAddSubgroup() { using(EF_ZMT_DbContext.EF_ZMT_DbContext context = new EF_ZMT_DbContext.EF_ZMT_DbContext()) { FixedAssetService transaction = new FixedAssetService(); context.Context.ExecuteStoreCommand("DELETE FROM Subgroup"); Subgroup subgroup = new Subgroup() { name = "Środki wysokiej wartości", short_name = "N491" }; transaction.AddSubgroup(subgroup); Assert.AreEqual(context.Context.Subgroups.Count(), 1); subgroup = context.Context.Subgroups.FirstOrDefault(x => x.short_name == "N491"); Assert.IsNotNull(subgroup); Assert.AreEqual(subgroup.name, "Środki wysokiej wartości"); } }