Ejemplo n.º 1
0
        public void VersionExist()
        {
            ArmClientOptions options = new ArmClientOptions();

            options.FakeRestApiVersions().FakeResourceVersion = FakeResourceApiVersions.V2019_12_01;
            string result = options.ApiVersions.TryGetApiVersion(options.FakeRestApiVersions().FakeResourceVersion.ResourceType);

            Assert.NotNull(result);
        }
Ejemplo n.º 2
0
        public void ImplicitToString()
        {
            ArmClientOptions options = new ArmClientOptions();

            options.FakeRestApiVersions().FakeResourceVersion = FakeResourceApiVersions.V2019_12_01;
            string version = options.FakeRestApiVersions().FakeResourceVersion;

            Assert.IsTrue(version == "2019-12-01");
        }
Ejemplo n.º 3
0
        public void MultiClientSeparateVersions()
        {
            ArmClientOptions options1 = new ArmClientOptions();
            ArmClientOptions options2 = new ArmClientOptions();

            options2.FakeRestApiVersions().FakeResourceVersion = FakeResourceApiVersions.V2019_12_01;
            Assert.AreEqual(FakeResourceApiVersions.Default, options1.FakeRestApiVersions().FakeResourceVersion);
            Assert.AreEqual(FakeResourceApiVersions.V2019_12_01, options2.FakeRestApiVersions().FakeResourceVersion);
        }
Ejemplo n.º 4
0
        public void VersionLoadedChanges()
        {
            ArmClientOptions options = new ArmClientOptions();

            options.FakeRestApiVersions().FakeResourceVersion = FakeResourceApiVersions.V2019_12_01;
            string result = options.ApiVersions.TryGetApiVersion(options.FakeRestApiVersions().FakeResourceVersion.ResourceType);

            Assert.True(result.Equals(FakeResourceApiVersions.V2019_12_01));

            options.FakeRestApiVersions().FakeResourceVersion = FakeResourceApiVersions.Default;
            result = options.ApiVersions.TryGetApiVersion(options.FakeRestApiVersions().FakeResourceVersion.ResourceType.ToString());
            Assert.True(result.Equals(FakeResourceApiVersions.Default));
        }
Ejemplo n.º 5
0
        public void VersionsLoadedChangeSet()
        {
            ArmClientOptions options = new ArmClientOptions();

            options.ApiVersions.SetApiVersion(options.FakeRestApiVersions().FakeResourceVersion.ResourceType.ToString(), "2021-01-01-beta");
            string result = options.ApiVersions.TryGetApiVersion(options.FakeRestApiVersions().FakeResourceVersion.ResourceType.ToString());

            Assert.True(result.Equals("2021-01-01-beta"));

            options.FakeRestApiVersions().FakeResourceVersion = FakeResourceApiVersions.V2019_12_01;
            result = options.ApiVersions.TryGetApiVersion(options.FakeRestApiVersions().FakeResourceVersion.ResourceType.ToString());
            Assert.True(result.Equals(FakeResourceApiVersions.V2019_12_01));
        }
Ejemplo n.º 6
0
        public void EqualsMethod()
        {
            ArmClientOptions options1 = new ArmClientOptions();
            ArmClientOptions options2 = new ArmClientOptions();

            Assert.IsTrue(options1.FakeRestApiVersions().FakeResourceVersion.Equals(options2.FakeRestApiVersions().FakeResourceVersion));
        }
Ejemplo n.º 7
0
        public void NotEqualsOperator()
        {
            ArmClientOptions options1 = new ArmClientOptions();
            ArmClientOptions options2 = new ArmClientOptions();

            Assert.IsFalse(options1.FakeRestApiVersions().FakeResourceVersion != options2.FakeRestApiVersions().FakeResourceVersion);
        }
Ejemplo n.º 8
0
        public void EqualsMethodStringNull()
        {
            ArmClientOptions options = new ArmClientOptions();
            string           version = null;

            Assert.IsFalse(options.FakeRestApiVersions().FakeResourceVersion.Equals(version));
        }
Ejemplo n.º 9
0
        public void EqualsMethodAsObjectThatIsInt()
        {
            ArmClientOptions options = new ArmClientOptions();

            object obj = 1;

            Assert.IsFalse(options.FakeRestApiVersions().FakeResourceVersion.Equals(obj));
        }
Ejemplo n.º 10
0
        public void EqualsMethodAsObjectThatIsString()
        {
            ArmClientOptions options1 = new ArmClientOptions();
            ArmClientOptions options2 = new ArmClientOptions();

            object obj = options2.FakeRestApiVersions().FakeResourceVersion.ToString();

            Assert.IsTrue(options1.FakeRestApiVersions().FakeResourceVersion.Equals(obj));
        }
Ejemplo n.º 11
0
        public void VersionIsDefault()
        {
            ArmClientOptions options = new ArmClientOptions();

            Assert.AreEqual(FakeResourceApiVersions.Default, options.FakeRestApiVersions().FakeResourceVersion);
        }
Ejemplo n.º 12
0
        public void VersionToString()
        {
            ArmClientOptions options = new ArmClientOptions();

            Assert.AreEqual("2020-06-01", options.FakeRestApiVersions().FakeResourceVersion);
        }
Ejemplo n.º 13
0
        public void NotEqualsOperatorStringSecondNull()
        {
            ArmClientOptions options = new ArmClientOptions();

            Assert.IsTrue(options.FakeRestApiVersions().FakeResourceVersion != null);
        }
Ejemplo n.º 14
0
        public void NotEqualsOperatorStringFirstNull()
        {
            ArmClientOptions options = new ArmClientOptions();

            Assert.IsTrue(null != options.FakeRestApiVersions().FakeResourceVersion);
        }
Ejemplo n.º 15
0
        public void EqualsOperatorString()
        {
            ArmClientOptions options = new ArmClientOptions();

            Assert.IsTrue(FakeResourceApiVersions.Default == options.FakeRestApiVersions().FakeResourceVersion);
        }