Esempio n. 1
0
        public void Create_Valid_Professional()
        {
            // Arrange
            var builder = new ProfessionalBuilder(LocalNotification)
                  .WithName("Professional 1")
                  .WithAddress("Rua do comercio", "123", "APT 1", new ZipCode("12345678"))
                  .WithEmail("*****@*****.**")
                  .WithPhone("5563524178");

            // Act
            builder.Build();

            // Assert
            Assert.False(LocalNotification.HasNotification());
        }
Esempio n. 2
0
        public void Create_Professional_With_Invalid_Address_Number()
        {
            // Arrange
            var builder = new ProfessionalBuilder(LocalNotification)
                  .WithName("Professional 1")
                  .WithAddress("Rua do comercio", null, "APT 1", new ZipCode("12345678"))
                  .WithEmail("*****@*****.**")
                  .WithPhone("5563524178");

            // Act
            builder.Build();

            // Assert
            Assert.True(LocalNotification.HasNotification());
            var notifications = LocalNotification.GetAll();
            Assert.True(notifications.Any(a => a.Message == Professional.Error.ProfessionalAddressNumberMustHaveValue.ToString()));
        }