Esempio n. 1
0
        public void SetConfigurationContext_ShouldNotSetEnvironmentNameAndAppVersionIfConfigIsNull()
        {
            var builder = new NoticeBuilder();

            builder.SetConfigurationContext(null);

            var notice = builder.ToNotice();

            Assert.NotNull(notice.Context);
            Assert.True(string.IsNullOrEmpty(notice.Context.EnvironmentName));
            Assert.True(string.IsNullOrEmpty(notice.Context.AppVersion));
        }
Esempio n. 2
0
        public void SetConfigurationContext_ShouldSetEnvironmentNameAndAppVersion()
        {
            var builder = new NoticeBuilder();

            builder.SetConfigurationContext(new AirbrakeConfig
            {
                Environment = "local",
                AppVersion  = "1.2.3"
            });

            var notice = builder.ToNotice();

            Assert.NotNull(notice.Context);
            Assert.True(notice.Context.EnvironmentName.Equals("local"));
            Assert.True(notice.Context.AppVersion.Equals("1.2.3"));
        }