Ejemplo n.º 1
0
 public void TestGetValueThrows()
 {
     Private.JweMetricType jweMetric = new Private.JweMetricType(
         category: "telemetry",
         disabled: true,
         lifetime: Private.Lifetime.Application,
         name: "jwe_metric",
         sendInPings: new string[] { "store1" }
         );
     Assert.Throws <NullReferenceException>(() => jweMetric.TestGetValue());
 }
Ejemplo n.º 2
0
        public void TestJweGetValueReturnsCorrectJweDataRepresentation()
        {
            Private.JweMetricType jweMetric = new Private.JweMetricType(
                category: "telemetry",
                disabled: false,
                lifetime: Private.Lifetime.Application,
                name: "jwe_metric",
                sendInPings: new string[] { "store1" }
                );

            jweMetric.Set(this.header, this.key, this.initVector, this.cipherText, this.authTag);

            Private.JweData data = jweMetric.TestGetValue();
            Assert.Equal(data.Header, this.header);
            Assert.Equal(data.Key, this.key);
            Assert.Equal(data.InitVector, this.initVector);
            Assert.Equal(data.CipherText, this.cipherText);
            Assert.Equal(data.AuthTag, this.authTag);
        }