예제 #1
0
        public void should_remove_existing_endpoint()
        {
            var displayName = "remove test";
            var sipAddress  = "*****@*****.**";
            var conference  = new ConferenceBuilder().WithEndpoint(displayName, sipAddress).Build();

            var beforeCount = conference.GetEndpoints().Count;

            var endpoint = conference.GetEndpoints().First();

            conference.RemoveEndpoint(endpoint);

            var afterCount = conference.GetEndpoints().Count;

            afterCount.Should().BeLessThan(beforeCount);
        }
예제 #2
0
        public void should_throw_exception_when_removing_an_endpoint_that_does_not_exist()
        {
            var displayName = "remove test";
            var sipAddress  = "*****@*****.**";
            var conference  = new ConferenceBuilder().WithEndpoint(displayName, sipAddress).Build();

            var    beforeCount = conference.GetEndpoints().Count;
            var    endpoint    = new Endpoint("Display", "*****@*****.**", "1234", "Defence Sol");
            Action action      = () => conference.RemoveEndpoint(endpoint);

            action.Should().Throw <DomainRuleException>().Where(x =>
                                                                x.ValidationFailures.Any(v => v.Message == "Endpoint does not exist in conference"));

            var afterCount = conference.GetEndpoints().Count;

            beforeCount.Should().Be(afterCount);
        }