Beispiel #1
0
        public void BearerTokenWithPartitionDeserialization()
        {
            Scope scope = JsonConvert.DeserializeObject <Scope>(BEARERTOKEN_WITH_PARTITION);

            //Directive Check
            Assert.NotNull(scope);
            TestFunctionsV3.TestBearerTokenWithPartitionV3(scope, "some-access-token", "Room101", "some-user-id");
        }
        public void RequestCreation_AdjustPowerLevel_Test()
        {
            SmartHomeRequest requestFromString = JsonConvert.DeserializeObject <SmartHomeRequest>(REPORT_STATE);

            //Directive Check
            Assert.NotNull(requestFromString.Directive);
            //Header Check
            TestFunctionsV3.TestHeaderV3(requestFromString.Directive.Header, "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4", Namespaces.ALEXA, HeaderNames.REPORT_STATE);
            Assert.Equal("dFMb0z+PgpgdDmluhJ1LddFvSqZ/jCc8ptlAKulUj90jSqg==", requestFromString.Directive.Header.CorrelationToken);
            //Endpoint Check
            TestFunctionsV3.TestEndpointV3(requestFromString.Directive.Endpoint, "appliance-001");
            TestFunctionsV3.TestBearerTokenWithPartitionV3(requestFromString.Directive.Endpoint.Scope, "some-access-token", "Room101", "some-user-id");
            //Payload Check
            Assert.NotNull(requestFromString.Directive.Payload);
            Assert.Equal(typeof(Payload), requestFromString.GetPayloadType());
        }