Exemplo n.º 1
0
        public void ReturnsNullOnInit()
        {
            var availability = new ApplicationAvailability(_logger);

            var liveness  = availability.GetLivenessState();
            var readiness = availability.GetReadinessState();

            Assert.Null(liveness);
            Assert.Null(readiness);
        }
Exemplo n.º 2
0
        public void TracksAndReturnsState()
        {
            var availability = new ApplicationAvailability(_logger);

            availability.SetAvailabilityState("Test", LivenessState.Broken, GetType().Name);
            availability.SetAvailabilityState(availability.LivenessKey, LivenessState.Correct, GetType().Name);
            availability.SetAvailabilityState(availability.ReadinessKey, ReadinessState.AcceptingTraffic, GetType().Name);

            Assert.Equal(LivenessState.Broken, availability.GetAvailabilityState("Test"));
            Assert.Equal(LivenessState.Correct, availability.GetLivenessState());
            Assert.Equal(ReadinessState.AcceptingTraffic, availability.GetReadinessState());
        }