Exemple #1
0
        public void CustomerServiceViaVirtualMethod_should_get_current_UTC_date()
        {
            // Given
            var service = new CustomerServiceViaVirtualMethod();

            // When
            var now = service.GetUtcNow();

            // Then
            Assert.That(now, Is.EqualTo(DateTime.UtcNow).Within(50).Milliseconds);
        }
Exemple #2
0
        public void CustomerServiceViaVirtualMethod_should_generate_unique_IDs()
        {
            // Given
            var service = new CustomerServiceViaVirtualMethod();

            // When
            var ids = Enumerable.Range(0, 100).Select(_ => service.NewId()).ToList();

            // Then
            Assert.That(ids, Is.Unique);
        }