781ef02142fb0b727e7374260dede76218397783
[test/tct/csharp/api.git] /
1 /*
2  *  Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *  Licensed under the Apache License, Version 2.0 (the "License");
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and8
14  *  limitations under the License
15  */
16
17 namespace Tizen.PrivacyPrivilegeManager.Manual.Tests
18 {
19     using global::System;
20     using NUnit.Framework;
21     using NUnit.Framework.TUnit;
22     using Tizen.Security;
23
24     /// <summary>
25     /// Contains <see cref="TSRequestMultipleResponseEventArgs"/> class
26     /// <para>It is used test if <see cref="Tizen.Security.TSRequestMultipleResponseEventArgs" /> works as expected.</para>
27     /// </summary>
28     [TestFixture]
29     [Description("Tizen.PrivacyPrivilegeManager Manual test")]
30     public class TSRequestMultipleResponseEventArgs
31     {
32         /// <summary>
33         /// Initializes environment before TCT test runs.
34         /// </summary>
35         [SetUp]
36         public void Init()
37         {
38             if (Profile.GetProfile().CompareTo(Profile.MobileProfile) != 0)
39             {
40                 Assert.Pass("Privacy privileges not supported");
41             }
42
43             LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
44         }
45
46         [Test]
47         [Category("P1")]
48         [Description("Test: Create instance of RequestMultipleResponseEventArgs")]
49         [Property("SPEC", "Tizen.Security.RequestMultipleResponseEventArgs.RequestMultipleResponseEventArgs C")]
50         [Property("SPEC_URL", "-")]
51         [Property("CRITERIA", "CONSTR")]
52         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
53         [Precondition(1, "NA")]
54         [Step(1, "Click run TC")]
55         [Step(2, "Click button")]
56         [Postcondition(1, "NA")]
57         public void RequestMultipleResponseEventArgs_CONSTRUCTOR()
58         {
59             try
60             {
61                 RequestMultipleResponseEventArgs eventArgs = new RequestMultipleResponseEventArgs();
62                 Assert.IsInstanceOf<RequestMultipleResponseEventArgs>(eventArgs, "Should return RequestMultipleResponseEventArgs");
63             }
64             catch (Exception ex)
65             {
66                 LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "Can`t make instance of RequestMultipleResponseEventArgs.\n" + ex.Message);
67                 Assert.Fail("Can`t make instance of RequestMultipleResponseEventArgs.\n" + ex.Message);
68             }
69         }
70
71         [Test]
72         [Category("P1")]
73         [Description("Test: Check if property RequestMultipleResponseEventArgs.cause is accessable.")]
74         [Property("SPEC", "Tizen.Security.RequestMultipleResponseEventArgs.Cause A")]
75         [Property("SPEC_URL", "-")]
76         [Property("CRITERIA", "PRO")]
77         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
78         [Precondition(1, "NA")]
79         [Step(1, "Click run TC")]
80         [Step(2, "Click button")]
81         [Postcondition(1, "NA")]
82         public void Cause_READ_ONLY()
83         {
84             try
85             {
86                 RequestMultipleResponseEventArgs eventArgs = new RequestMultipleResponseEventArgs();
87                 CallCause cause = eventArgs.Cause;
88                 Assert.IsInstanceOf<CallCause>(cause, "Should return CallCause");
89             }
90             catch (Exception ex)
91             {
92                 LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, ex.Message);
93                 Assert.Fail(ex.Message);
94             }
95         }
96
97         [Test]
98         [Category("P1")]
99         [Description("Test: Check if property RequestMultipleResponseEventArgs.Responses are accessable.")]
100         [Property("SPEC", "Tizen.Security.RequestMultipleResponseEventArgs.Responses A")]
101         [Property("SPEC_URL", "-")]
102         [Property("CRITERIA", "PRO")]
103         [Property("AUTHOR", "Ernest Borowski, e.borowski@partner.samsung.com")]
104         [Precondition(1, "NA")]
105         [Step(1, "Click run TC")]
106         [Step(2, "Click button")]
107         [Postcondition(1, "NA")]
108         public void Responses_READ_ONLY()
109         {
110             try
111             {
112                 RequestMultipleResponseEventArgs eventArgs = new RequestMultipleResponseEventArgs();
113                 global::System.Collections.Generic.IEnumerable<PermissionRequestResponse> responses = eventArgs.Responses;
114                 Assert.IsNull(responses, "Should be null");
115             }
116             catch (Exception ex)
117             {
118                 LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, ex.Message);
119                 Assert.Fail(ex.Message);
120             }
121         }
122     }
123 }