Exemple #1
0
        public void Create_Valid_President()
        {
            // Arrange
            var builder = new PresidentBuilder(LocalNotification)
                          .WithId("1")
                          .WithName("George Washington")
                          .WithAddress("Rua de teste", "123", "APT 12", "99380000");

            // Act
            builder.Build();

            // Assert
            Assert.False(LocalNotification.HasNotification());
        }
Exemple #2
0
        public void Create_President_With_Invalid_Address_Number()
        {
            // Arrange
            var builder = new PresidentBuilder(LocalNotification)
                          .WithId("1")
                          .WithName("George Washington")
                          .WithAddress("Rua de teste", null, "APT 12", "99380000");

            // Act
            builder.Build();

            // Assert
            Assert.True(LocalNotification.HasNotification());
            var notifications = LocalNotification.GetAll();

            Assert.True(notifications.Any(a => a.Message == President.Error.PresidentAddressNumberMustHaveValue.ToString()));
        }