Example #1
0
        public void YandexMetrika_HasYandexMetrikaType()
        {
            // Act
            YandexMetrika metrika = new YandexMetrika("123456");

            // Assert
            metrika.Type.Should().BeEquivalentTo(AnalyticsTypes.YandexMetrika);
        }
Example #2
0
        public void ToXElement_NoYandexMetrikaParams_ReturnsXElementWithoutParamsAttribute()
        {
            // Arrange
            const string  MetrikaId = "123456";
            YandexMetrika metrika   = new YandexMetrika(MetrikaId);

            // Act
            XElement result = metrika.ToXElement();

            // Assert
            result.Should().NotBeNull();
            result.Name.LocalName.Should().BeEquivalentTo("analytics");
            result.Name.Namespace.Should().BeEquivalentTo(TurboYandexNamespace);
            result.Should().HaveAttribute("type", AnalyticsTypes.YandexMetrika)
            .And.HaveAttribute("id", MetrikaId);
            result.Attribute("params").Should().BeNull();
        }