public void AffordanceStandbyTests1()
 {
     using (var db = new DatabaseSetup(Utili.GetCurrentMethodAndClass()))
     {
         Config.IsInUnitTesting = true;
         var col = new ColorRGB(255, 0, 0);
         var aff = new Affordance("bla", null, null, true, PermittedGender.Female, 0.1m, col,
                                  "AffordanceCategory", null, "desc", db.ConnectionString, true, true, 0, 99, false,
                                  ActionAfterInterruption.GoBackToOld, false, Guid.NewGuid().ToStrGuid(), BodilyActivityLevel.Low);
         aff.SaveToDB();
         aff.AffordanceStandbys.Count.Should().Be(0);
         var rd2 = new RealDevice("rd2", 1, string.Empty, null, string.Empty, false, false, db.ConnectionString, Guid.NewGuid().ToStrGuid());
         rd2.SaveToDB();
         aff.AddStandby(rd2);
         aff.AffordanceStandbys.Count.Should().Be(1);
         db.Cleanup();
     }
 }
        public void AffordanceStandbyTests2()
        {
            using (var db = new DatabaseSetup(Utili.GetCurrentMethodAndClass()))
            {
                db.ClearTable(Affordance.TableName);
                db.ClearTable(AffordanceStandby.TableName);
                db.ClearTable(AffordanceDevice.TableName);
                db.ClearTable(AffordanceDesire.TableName);
                db.ClearTable(AffordanceSubAffordance.TableName);
                db.ClearTable(AffordanceTaggingEntry.TableName);
                db.ClearTable(HHTAffordance.TableName);
                db.ClearTable(AffVariableRequirement.TableName);

                Config.IsInUnitTesting = true;
                var col = new ColorRGB(255, 0, 0);
                var aff = new Affordance("bla", null, null, true, PermittedGender.Female, 0.1m, col,
                                         "AffordanceCategory", null, "desc", db.ConnectionString, true, true, 0, 99, false,
                                         ActionAfterInterruption.GoBackToOld, false, Guid.NewGuid().ToStrGuid(), BodilyActivityLevel.Low);
                aff.SaveToDB();
                aff.AffordanceStandbys.Count.Should().Be(0);
                var rd2 = new RealDevice("rd2", 1, string.Empty, null, string.Empty, false, false, db.ConnectionString, Guid.NewGuid().ToStrGuid());
                rd2.SaveToDB();
                aff.AddStandby(rd2);
                aff.SaveToDB();
                aff.AffordanceStandbys.Count.Should().Be(1);
                var sim2             = new Simulator(db.ConnectionString);
                var loadedAffordance = sim2.Affordances.It[0];
                loadedAffordance.AffordanceStandbys.Count.Should().Be(1);
                loadedAffordance.AffordanceStandbys[0].Device?.Name.Should().Be("rd2");
                loadedAffordance.DeleteStandby(loadedAffordance.AffordanceStandbys[0]);
                loadedAffordance.AffordanceStandbys.Count.Should().Be(0);
                var sim3 = new Simulator(db.ConnectionString);
                var affordanceLoaded2 = sim3.Affordances.It[0];
                affordanceLoaded2.AffordanceStandbys.Count.Should().Be(0);
                db.Cleanup();
            }
        }