Skip to main content

I'm new to Sitecore FakeDb NUnit Testing.While Testing While testing the Codecode, I found that

 Sitecore.Context.Item =null= null;
 RenderingContext.Current.Rendering.DataSource = fakeItem.ID.ToString();

Since the item is passed as Null, the corresponding datedata source overwrites the value.Is

Is this a Bug or  ,Im I'm getting it wrong here?

I'm new to Sitecore FakeDb NUnit Testing.While Testing the Code I found that

 Sitecore.Context.Item =null
 RenderingContext.Current.Rendering.DataSource = fakeItem.ID.ToString();

Since the item is passed as Null, the corresponding date source overwrites the value.Is this a Bug or  ,Im wrong?

I'm new to Sitecore FakeDb NUnit Testing. While testing the code, I found that

 Sitecore.Context.Item = null;
 RenderingContext.Current.Rendering.DataSource = fakeItem.ID.ToString();

Since the item is passed as Null, the corresponding data source overwrites the value.

Is this a Bug or, I'm getting it wrong here?

Source Link
rams
  • 317
  • 1
  • 3
  • 18

Sitecore.Context.Item is Overwritten by RenderingContext.Current.Rendering

I'm new to Sitecore FakeDb NUnit Testing.While Testing the Code I found that

 Sitecore.Context.Item =null
 RenderingContext.Current.Rendering.DataSource = fakeItem.ID.ToString();

Since the item is passed as Null, the corresponding date source overwrites the value.Is this a Bug or ,Im wrong?