public void CantEditSubgroup()
 {
     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" };
         Assert.AreEqual(context.Context.Subgroups.Count(), 0);
         transaction.EditSubgroup(subgroup);
     }
 }
        public void CanEditSubgroup()
        {
            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");
                subgroup.name = "Środki niskiej wartości";
                transaction.EditSubgroup(subgroup);

                subgroup = context.Context.Subgroups.FirstOrDefault(x => x.name == "Środki niskiej wartości");
                Assert.IsNotNull(subgroup);
                Assert.AreEqual(subgroup.short_name, "N491");
                Assert.AreEqual(context.Context.Subgroups.Count(), 1);
            }
        }