Exemple #1
0
        public void Parameter_PowerImported_CreatesCorrectUriParameters()
        {
            var post = new BatchNetStatusPost()
            {
                PowerImported = 2222
            };

            string[] postArray = GetSplitStatusPostLine(post);
            Assert.That(postArray[5], Is.EqualTo("2222"));
        }
Exemple #2
0
        public void Parameter_Timestamp_CreatesCorrectUriParameters()
        {
            var post = new BatchNetStatusPost()
            {
                Timestamp = new DateTime(2020, 2, 1, 13, 12, 20)
            };

            string[] postArray = GetSplitStatusPostLine(post);
            Assert.That(postArray[0], Is.EqualTo("20200201"));
            Assert.That(postArray[1], Is.EqualTo("13:12"));
        }
 /// <summary>
 /// Resets the builder to it's default state. Ready to build a new status.
 /// </summary>
 public void Reset() => _statusPost = new BatchNetStatusPost();
 /// <summary>
 /// Creates a new builder.
 /// </summary>
 public BatchNetStatusPostBuilder()
 {
     _statusPost = new BatchNetStatusPost();
 }
Exemple #5
0
 private string[] GetSplitStatusPostLine(BatchNetStatusPost post) => AddBatchNetStatusRequest.FormatStatusPost(post).Split(',');