Exemplo n.º 1
0
 public VisitAction(Visit visit, VisitActionType actionType, BehaviorMonitoredItem behaviorMonitoredItem)
 {
     if (visit == null)
     {
         throw new ArgumentNullException("visit");
     }
     if (behaviorMonitoredItem == null)
     {
         throw new ArgumentNullException("behaviorMonitoredItem");
     }
     Visit = visit;
     VisitActionType = actionType;
     BehaviorMonitoredItem = behaviorMonitoredItem;
     ActionDate = DateTime.UtcNow;
 }
            public void Uri_ContentType()
            {
                var uri = new Uri("http://www.medseek.com/Pages/Home.aspx");
                var contentType = "Page";
                var item = new BehaviorMonitoredItem(uri, contentType);

                Assert.AreEqual(contentType, item.ContentType);
                Assert.AreEqual(uri.ToString(), item.AbsoluteUrl);
                Assert.AreEqual(uri.PathAndQuery, item.RawUrl);
                Assert.IsNull(item.ItemId);
                Assert.IsNull(item.CountFromDate);
                Assert.IsFalse(item.IsExcluded);
                Assert.GreaterOrEqual(DateTime.UtcNow, item.CreatedDate);
                Assert.IsNotNullOrEmpty(item.ViewModel);
            }
            public void Uri_ContentType_ItemID()
            {
                var uri = new Uri("http://www.medseek.com/Lists/Navigation/DispForm.aspx?ID=444");
                var contentType = "Navigation";
                var itemId = "444";
                var item = new BehaviorMonitoredItem(uri, contentType, itemId);

                Assert.AreEqual(contentType, item.ContentType);
                Assert.AreEqual(uri.ToString(), item.AbsoluteUrl);
                Assert.AreEqual(uri.PathAndQuery, item.RawUrl);
                Assert.AreEqual(itemId, item.ItemId);
                Assert.IsNull(item.CountFromDate);
                Assert.IsFalse(item.IsExcluded);
                Assert.GreaterOrEqual(DateTime.UtcNow, item.CreatedDate);
                Assert.IsNotNullOrEmpty(item.ViewModel);
            }
            public void Uri_ContentType_ItemID_RawUrl()
            {
                var uri = new Uri("http://www.medseek.com/pages/pnrs/providerprofile.aspx?providerid=123");
                var rawUrl = "/provider/dr-john-doe-cardiology";
                var contentType = "Provider";
                var itemId = "123";
                var item = new BehaviorMonitoredItem(uri, contentType, itemId, rawUrl);

                Assert.AreEqual(contentType, item.ContentType);
                Assert.AreEqual(uri.ToString(), item.AbsoluteUrl);
                Assert.AreEqual(rawUrl, item.RawUrl);
                Assert.AreEqual(itemId, item.ItemId);
                Assert.IsNull(item.CountFromDate);
                Assert.IsFalse(item.IsExcluded);
                Assert.GreaterOrEqual(DateTime.UtcNow, item.CreatedDate);
                Assert.IsNotNullOrEmpty(item.ViewModel);
            }
Exemplo n.º 5
0
 private static BehaviorMonitoredItem CreateItem()
 {
     var item = new BehaviorMonitoredItem(new Uri("http://localhost"), "Page");
     return item;
 }