Esempio n. 1
0
 protected override void EstablishContext()
 {
     base.EstablishContext();
     AlarmTag = new alarm_tags
                    {
                        dig_tags = new dig_tags
                                       {
                                           id = RandomGenerator.GetRandomInt32(),
                                           io_devices = new io_devices
                                                            {
                                                                id = RandomGenerator.GetRandomInt32()
                                                            }
                                       },
                        id = RandomGenerator.GetRandomInt32(),
                        acknowledgeable = Acknowledgeable
                    };
     AlarmCatetory = new alarm_categories
                         {
                             name = "AlarmCategory",
                             time_to_store = TimeToStore
                         };
     AlarmCatetory.alarm_tags.Add(AlarmTag);
     Reporter = new Mock<INotificationReporter>();
     Repository = new Mock<IAlarmsRepository>();
     Project = new Mock<IProject>();
     TimeService = new Mock<ITimeService>();
     TimeService.Setup(t => t.UtcTime).Returns(DateTime.UtcNow);
     ConnectionFactory = new Mock<INpgsqlConnectionFactory>();
     Connection = new NpgsqlConnection();
     ConnectionFactory.Setup(f => f.Create()).Returns(Connection);
     AlarmsRunTarget = new AlarmsRunTarget(
         AlarmCatetory,
         Reporter.Object,
         Repository.Object,
         Project.Object,
         TimeService.Object,
         ConnectionFactory.Object);
 }
Esempio n. 2
0
 /// <summary>
 /// Create a new alarm_tags object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="name">Initial value of the name property.</param>
 /// <param name="ref_dig_tags">Initial value of the ref_dig_tags property.</param>
 /// <param name="ref_categories">Initial value of the ref_categories property.</param>
 /// <param name="acknowledgeable">Initial value of the acknowledgeable property.</param>
 public static alarm_tags Createalarm_tags(global::System.Int32 id, global::System.String name, global::System.Int32 ref_dig_tags, global::System.Int32 ref_categories, global::System.Boolean acknowledgeable)
 {
     alarm_tags alarm_tags = new alarm_tags();
     alarm_tags.id = id;
     alarm_tags.name = name;
     alarm_tags.ref_dig_tags = ref_dig_tags;
     alarm_tags.ref_categories = ref_categories;
     alarm_tags.acknowledgeable = acknowledgeable;
     return alarm_tags;
 }
Esempio n. 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the alarm_tags EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToalarm_tags(alarm_tags alarm_tags)
 {
     base.AddObject("alarm_tags", alarm_tags);
 }