Palak Shah
Well-known member
- Joined
- Apr 29, 2020
- Messages
- 97
- Programming Experience
- 1-3
Good day, everyone!
I have two lists (before and after) with me that contain integer values. The only difference between the two lists is that if one of the values in the before list is 1, then one of the values in the after list will be 1 + 1 = 2.
Which I need to compare, but I'm having trouble doing it. Can someone assist me?
Here's the code and the problem I'm having.
Before List: 31,5,2,3,2,1
After List: 31,5,2,3,2,2
I have two lists (before and after) with me that contain integer values. The only difference between the two lists is that if one of the values in the before list is 1, then one of the values in the after list will be 1 + 1 = 2.
Which I need to compare, but I'm having trouble doing it. Can someone assist me?
Here's the code and the problem I'm having.
Before List: 31,5,2,3,2,1
After List: 31,5,2,3,2,2
C#:
yield return !Enumerable.SequenceEqual(beforeClickNumberOfClicks, afterClickNumberOfClicks);
var beforeClickNumberOfClickForTag = beforeClickNumberOfClicks.Except(afterClickNumberOfClicks);
var afterClickNumberOfClickForTag = afterClickNumberOfClicks.Except(beforeClickNumberOfClicks);
yield return beforeClickNumberOfClickForTag.Count().Equals(1);
yield return afterClickNumberOfClickForTag.Count().Equals(1);
yield return (beforeClickNumberOfClickForTag.First() + 1).Equals(afterClickNumberOfClickForTag.First());