示例#1
0
        public ColabSpaceDbContextTests()
        {
            _dateTime     = new DateTime(3001, 1, 1);
            _dateTimeMock = new Mock <IDateTime>();
            _dateTimeMock.Setup(m => m.Now).Returns(_dateTime);

            _userId = "00000000-0000-0000-0000-000000000000";
            _currentUserServiceMock = new Mock <ICurrentUserService>();
            _currentUserServiceMock.Setup(m => m.UserId).Returns(_userId);

            var options = new DbContextOptionsBuilder <ColabSpaceDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;

            _sut = new ColabSpaceDbContext(options, _currentUserServiceMock.Object, _dateTimeMock.Object);

            var users = new List <User>
            {
                new User()
                {
                    UserOid     = _userId,
                    DisplayName = "TestUser1"
                }
            };

            _sut.Teams.Add(new Team
            {
                Id    = teamId,
                Name  = "Team1",
                Users = users
            });

            _sut.SaveChanges();
        }
示例#2
0
        public static void InitializeDbForTests(ColabSpaceDbContext context)
        {
            string loginUserId = "020cdee0-8ecd-408a-b662-cd4d9cdf0100";

            context.Teams.AddRange(
                new Team
            {
                Id          = new Guid("197d0438-e04b-453d-b5de-eca05960c6ae"),
                Name        = "Team 1",
                Description = "Des1",
                Users       = new List <User>
                {
                    new User()
                    {
                        UserOid     = loginUserId,
                        DisplayName = "TestUser1",
                        TeamRole    = "Leader"
                    }
                }
            },
                new Team
            {
                Id          = new Guid("7567347E-0580-4807-97F1-8EDAD42C9758"),
                Name        = "Team 2",
                Description = "Des2",
                Users       = new List <User>
                {
                    new User()
                    {
                        UserOid     = loginUserId,
                        DisplayName = "TestUser1",
                        TeamRole    = "Leader"
                    }
                }
            },
                new Team
            {
                Id          = Guid.NewGuid(),
                Name        = "Team 3",
                Description = "Des3",
                Users       = new List <User>
                {
                    new User()
                    {
                        UserOid     = loginUserId,
                        DisplayName = "TestUser1",
                        TeamRole    = "Leader"
                    }
                }
            },
                new Team
            {
                Id          = Guid.NewGuid(),
                Name        = "Team 4",
                Description = "Des4",
                Users       = new List <User>
                {
                    new User()
                    {
                        UserOid     = Guid.NewGuid().ToString(),
                        DisplayName = "TestUser1",
                        TeamRole    = "Leader"
                    }
                }
            }
                );
            context.TaskItems.AddRange(
                new TaskItem
            {
                Id          = new Guid("197d0438-e04b-453d-b5de-eca05960c6ae"),
                Name        = "Task 1",
                Description = "Des1",
                CreatedBy   = new User()
                {
                    UserOid = loginUserId, DisplayName = "TestUser1"
                },
                Status = 1,
                TeamId = new Guid("197d0438-e04b-453d-b5de-eca05960c6ae"),
                IsPin  = true
            },
                new TaskItem
            {
                Id          = new Guid("DE14A885-71D4-4DA0-BB17-048D74D33ADA"),
                Name        = "Task 2",
                Description = "Des2",
                CreatedBy   = new User()
                {
                    UserOid = loginUserId, DisplayName = "TestUser1"
                },
                Status = 1,
                TeamId = new Guid("197d0438-e04b-453d-b5de-eca05960c6ae"),
                IsPin  = true
            },
                new TaskItem
            {
                Id          = Guid.NewGuid(),
                Name        = "Task 3",
                Description = "Des3",
                CreatedBy   = new User()
                {
                    UserOid = loginUserId, DisplayName = "TestUser1"
                },
                Status = 1,
                TeamId = Guid.NewGuid(),
            },
                new TaskItem
            {
                Id          = Guid.NewGuid(),
                Name        = "Task 4",
                Description = "Des4",
                CreatedBy   = new User()
                {
                    UserOid = loginUserId, DisplayName = "TestUser1"
                },
                Status = 1,
                TeamId = Guid.NewGuid(),
            }
                );

            //context.HelpItems.AddRange(
            //    new HelpItem()
            //    {
            //        Id = new Guid("7B41389E-7C41-4594-8AF7-06F01D21F973"),
            //        Name = "Topic",
            //        Description = string.Empty,
            //        Content = new AttachFile()
            //        {
            //            FileName = "test.a",
            //            FileSize = 10,
            //            BlobStorageUrl = null,
            //            FileStorageName = "test.b",
            //        },
            //    }
            //);

            context.Conversations.AddRange(
                new Conversation
            {
                Name     = string.Empty,
                isPublic = false,
                Members  = new List <User>
                {
                    new User
                    {
                        UserOid     = loginUserId,
                        DisplayName = "TestUser1"
                    },
                    new User
                    {
                        UserOid     = Guid.NewGuid().ToString(),
                        DisplayName = "TestUser1"
                    }
                },
                Type   = "pair",
                TeamId = null,
                Id     = new Guid("B73477A4-F61D-46FA-873C-7D71C01DFBDF")
            }, new Conversation
            {
                Name     = string.Empty,
                isPublic = false,
                Members  = new List <User>
                {
                    new User
                    {
                        UserOid     = loginUserId,
                        DisplayName = "TestUser1"
                    },
                    new User
                    {
                        UserOid     = "9a1709db-fddf-4f91-8046-e3bc92316bab",
                        DisplayName = "TestUser2"
                    }
                },
                Type   = "pair",
                TeamId = null,
                Id     = Guid.NewGuid()
            }, new Conversation
            {
                Name     = "duplicate",
                isPublic = true,
                Members  = new List <User>
                {
                    new User
                    {
                        UserOid     = loginUserId,
                        DisplayName = "TestUser1"
                    },
                    new User
                    {
                        UserOid     = "9a1709db-fddf-4f91-8046-e3bc92316bab",
                        DisplayName = "TestUser2"
                    }
                },
                Type      = "channel",
                TeamId    = "197d0438-e04b-453d-b5de-eca05960c6ae",
                Id        = new Guid("CF7F4DE0-58B8-4CE1-8758-055706A41BE7"),
                CreatedBy = "020cdee0-8ecd-408a-b662-cd4d9cdf0100"
            }
                );

            context.Notifications.AddRange(new[] {
                new Notification()
                {
                    MessageContent = "message 2 @USER2",
                    ConversationId = Guid.NewGuid().ToString(),
                    MessageId      = Guid.NewGuid().ToString(),
                    CreatedBy      = Guid.NewGuid().ToString(),
                    RegUserName    = "******",
                    isRead         = false,
                    ToUser         = new User {
                        UserOid = new Guid("66EDB7C7-11BF-40A5-94AB-75A3364FEF60").ToString(), DisplayName = "USER2"
                    },
                    Type = "Mention"
                }
            });

            context.MessageChats.AddRange(
                new MessageChat
            {
                Id             = new Guid("B73477A4-F61D-46FA-873C-7D71C01DFBDF"),
                ConversationId = new Guid("B73477A4-F61D-46FA-873C-7D71C01DFBDF"),
                Content        = "abc",
                RegUserName    = "******",
                Created        = DateTime.UtcNow
            },
                new MessageChat
            {
                Id                = new Guid("96149786-A9F7-4B6A-A932-5DDB15A84D1A"),
                ConversationId    = new Guid("B73477A4-F61D-46FA-873C-7D71C01DFBDF"),
                Content           = "abc",
                RegUserName       = "******",
                RelatedMessagesId = new Guid("B73477A4-F61D-46FA-873C-7D71C01DFBDF"),
                RelatedTaskId     = new Guid("197d0438-e04b-453d-b5de-eca05960c6ae"),
                Created           = DateTime.UtcNow
            }
                );


            context.Planners.AddRange(new[]
            {
                new Planner()
                {
                    Id      = new Guid("CBB85A08-ED54-4924-9135-E1F723A2BA6B"),
                    TeamId  = new Guid("197d0438-e04b-453d-b5de-eca05960c6ae"),
                    Title   = "Planner 1",
                    Purpose = "Purpose 1",
                    Tags    = new List <Tag>
                    {
                        new Tag()
                        {
                            TagName = "Tag 1"
                        },
                        new Tag()
                        {
                            TagName = "Tag 2"
                        }
                    },
                    Milestones = new List <Milestone>
                    {
                        new Milestone()
                        {
                            Title       = "Milestone 1",
                            Description = "Milestone 1 Description",
                            Date        = DateTime.UtcNow,
                            TaskIds     = new List <Guid>
                            {
                                new Guid("197d0438-e04b-453d-b5de-eca05960c6ae"),
                                new Guid("DE14A885-71D4-4DA0-BB17-048D74D33ADA"),
                            }
                        },
                        new Milestone()
                        {
                            Title       = "Milestone 2",
                            Description = "Milestone 2 Description",
                            Date        = DateTime.UtcNow,
                        }
                    }
                },
                new Planner()
                {
                    Id      = new Guid("5F6FC408-D2A5-4BA2-A73E-A4F9125A26B1"),
                    TeamId  = new Guid("197d0438-e04b-453d-b5de-eca05960c6ae"),
                    Title   = "Planner 2",
                    Purpose = "Purpose 2",
                    Tags    = new List <Tag>
                    {
                        new Tag()
                        {
                            TagName = "Tag 2"
                        },
                        new Tag()
                        {
                            TagName = "Tag 3"
                        }
                    }
                },
                new Planner()
                {
                    Id      = new Guid("744C1463-0BEB-48AD-AB79-865B5183651F"),
                    TeamId  = new Guid("7567347E-0580-4807-97F1-8EDAD42C9758"),
                    Title   = "Planner 3",
                    Purpose = "Purpose 3",
                    Tags    = new List <Tag>
                    {
                        new Tag()
                        {
                            TagName = "Tag 3"
                        },
                        new Tag()
                        {
                            TagName = "Tag 1"
                        }
                    }
                }
            });

            context.SaveChanges();
        }
        public static void SeedSampleData(ColabSpaceDbContext context)
        {
            context.Teams.AddRange(new[] {
                new Team
                {
                    Id    = teamId1,
                    Name  = "Team1",
                    Users = new List <User>
                    {
                        new User
                        {
                            UserOid     = userId1.ToString(),
                            DisplayName = "User1",
                            TeamRole    = "Leader"
                        },
                        new User
                        {
                            UserOid     = userId2.ToString(),
                            DisplayName = "User2",
                            TeamRole    = "Member"
                        },
                        new User
                        {
                            UserOid     = userId3.ToString(),
                            DisplayName = "User3",
                            TeamRole    = "Member"
                        },
                        new User
                        {
                            UserOid     = userId4.ToString(),
                            DisplayName = "User4",
                            TeamRole    = "Member"
                        }
                    }
                },
                new Team {
                    Id = teamId2, Name = "Team2"
                },
                new Team {
                    Id = teamId3, Name = "Team3"
                },
            });

            context.TaskItems.AddRange(new[]
            {
                new TaskItem {
                    Id     = taskItemId1,
                    Name   = "Task1",
                    TeamId = teamId1,
                    //AttachFiles = attachFiles,
                    CreatedBy = new User {
                        DisplayName = "User1", UserOid = userId1.ToString()
                    },
                    Assignee = new User {
                        DisplayName = "User3", UserOid = userId3.ToString()
                    },
                    IsPin = true
                },
                new TaskItem {
                    Id     = taskItemId2,
                    Name   = "Task2",
                    TeamId = teamId1,
                    //AttachFiles = attachFiles,
                    CreatedBy = new User {
                        DisplayName = "User2", UserOid = userId2.ToString()
                    },
                    Assignee = new User {
                        DisplayName = "User3", UserOid = userId3.ToString()
                    },
                    IsPin = true
                },
                new TaskItem {
                    Id     = Guid.NewGuid(),
                    Name   = "Test for TEST search by assignee",
                    TeamId = teamId1,
                    //AttachFiles = attachFiles,
                    CreatedBy = new User {
                        DisplayName = "User2", UserOid = userId2.ToString()
                    },
                    Assignee = new User {
                        DisplayName = "Assignee", UserOid = userId3.ToString()
                    },
                    IsPin = true
                },
                new TaskItem {
                    Id     = taskItemId3,
                    Name   = "Task3",
                    TeamId = teamId2,
                    //AttachFiles = attachFiles,
                    CreatedBy = new User {
                        DisplayName = "User1", UserOid = userId1.ToString()
                    },
                    Assignee = new User {
                        DisplayName = "User3", UserOid = userId3.ToString()
                    },
                    IsPin = false
                },
                new TaskItem {
                    Id     = taskItemId4,
                    Name   = "Task4",
                    TeamId = teamId4,
                    //AttachFiles = attachFiles,
                    CreatedBy = new User {
                        DisplayName = "User2", UserOid = userId2.ToString()
                    },
                    Assignee = new User {
                        DisplayName = "User3", UserOid = userId3.ToString()
                    },
                    IsPin = true
                },
            });
            context.Conversations.AddRange(new[]
            {
                new Conversation
                {
                    Id      = conversation1,
                    Members = new List <User>
                    {
                        new User
                        {
                            UserOid     = userId1.ToString(),
                            DisplayName = "User1",
                        },
                        new User
                        {
                            UserOid     = userId2.ToString(),
                            DisplayName = "User2",
                        },
                    },
                    Type = "pair"
                }, new Conversation
                {
                    Id      = conversation3,
                    Members = new List <User>
                    {
                        new User
                        {
                            UserOid     = userId1.ToString(),
                            DisplayName = "User1",
                        },
                        new User
                        {
                            UserOid     = userId2.ToString(),
                            DisplayName = "User2",
                        },
                        new User
                        {
                            UserOid     = userId3.ToString(),
                            DisplayName = "User3",
                        },
                    },
                    Type = "group",
                    Name = "Group 3"
                },
                new Conversation
                {
                    Id      = conversation2,
                    Members = new List <User>
                    {
                        new User
                        {
                            UserOid     = userId1.ToString(),
                            DisplayName = "User1",
                        },
                        new User
                        {
                            UserOid     = userId3.ToString(),
                            DisplayName = "User3",
                        },
                    },
                    Type = "pair"
                },
                new Conversation
                {
                    Id      = channelId1,
                    Members = new List <User>
                    {
                        new User
                        {
                            UserOid     = userId1.ToString(),
                            DisplayName = "User1",
                        },
                        new User
                        {
                            UserOid     = userId2.ToString(),
                            DisplayName = "User3",
                        },
                    },
                    Type      = "channel",
                    TeamId    = teamId1.ToString(),
                    CreatedBy = userId1.ToString(),
                    Name      = channel1Name
                },
                new Conversation
                {
                    Id      = channelId2,
                    Members = new List <User>
                    {
                        new User
                        {
                            UserOid     = userId1.ToString(),
                            DisplayName = "User1",
                        },
                        new User
                        {
                            UserOid     = userId2.ToString(),
                            DisplayName = "User3",
                        },
                    },
                    Type      = "channel",
                    TeamId    = teamId1.ToString(),
                    CreatedBy = userId2.ToString(),
                    Name      = channel2Name
                },
                new Conversation
                {
                    Id      = channelId3,
                    Members = new List <User>
                    {
                        new User
                        {
                            UserOid     = userId1.ToString(),
                            DisplayName = "User1",
                        },
                        new User
                        {
                            UserOid     = userId2.ToString(),
                            DisplayName = "User3",
                        },
                    },
                    Type      = "channel",
                    TeamId    = teamId3.ToString(),
                    CreatedBy = userId2.ToString(),
                    Name      = channel3Name
                },
                new Conversation
                {
                    Id      = channelId4,
                    Members = new List <User>
                    {
                        new User
                        {
                            UserOid     = userId1.ToString(),
                            DisplayName = "User1",
                        },
                        new User
                        {
                            UserOid     = userId2.ToString(),
                            DisplayName = "User3",
                        },
                    },
                    Type      = "channel",
                    TeamId    = Guid.NewGuid().ToString(),
                    CreatedBy = userId2.ToString(),
                    Name      = channel4Name
                }, new Conversation
                {
                    Id      = channelId5,
                    Members = new List <User>
                    {
                        new User
                        {
                            UserOid     = userId1.ToString(),
                            DisplayName = "User1",
                        },
                        new User
                        {
                            UserOid     = userId2.ToString(),
                            DisplayName = "User3",
                        },
                    },
                    Type      = "channel",
                    TeamId    = teamId1.ToString(),
                    CreatedBy = userId2.ToString(),
                    Name      = channel5Name,
                    isPublic  = true
                },
                new Conversation
                {
                    Id      = channelId6,
                    Members = new List <User>
                    {
                        new User
                        {
                            UserOid     = userId1.ToString(),
                            DisplayName = "User1",
                        },
                        new User
                        {
                            UserOid     = userId2.ToString(),
                            DisplayName = "User3",
                        },
                    },
                    Type      = "channel",
                    TeamId    = teamId2.ToString(),
                    CreatedBy = userId2.ToString(),
                    Name      = channel6Name,
                    isPublic  = true
                }
            });

            context.MessageChats.AddRange(new[]
            {
                new MessageChat
                {
                    Id             = messageId1,
                    Content        = "message 1",
                    ConversationId = conversation1,
                    RegUserName    = "******",
                    AttachFileList = new List <AttachFile>
                    {
                        new AttachFile
                        {
                            BlobStorageUrl  = validBlobStorageUrl,
                            FileName        = "file",
                            FileSize        = 20,
                            FileStorageName = "kxg5qfz4.jxl",
                            IsPin           = false
                        }
                    }
                },
                new MessageChat
                {
                    Id             = messageId2,
                    Content        = "message 2",
                    ConversationId = conversation1,
                    RegUserName    = "******"
                },
                new MessageChat
                {
                    Id             = messageId3,
                    Content        = "message 3",
                    ConversationId = conversation2,
                    RegUserName    = "******"
                },
                new MessageChat
                {
                    Id             = messagechannelId1,
                    Content        = "message in channel 1",
                    ConversationId = channelId1,
                    RegUserName    = "******"
                },
                new MessageChat
                {
                    Id             = messagechannelId2,
                    Content        = "message in channel 2",
                    ConversationId = channelId1,
                    RegUserName    = "******",
                    IsPin          = true
                },
                new MessageChat
                {
                    Id             = messagechannelId3,
                    Content        = "message has one reaction",
                    ConversationId = channelId1,
                    RegUserName    = "******",
                    ReactionList   = new List <Reaction>
                    {
                        new Reaction
                        {
                            ReactorId    = userId1.ToString(),
                            ReactorName  = "User1",
                            ReactionType = "Like"
                        }
                    },
                    IsPin = true
                },
                new MessageChat
                {
                    Id             = messagechannelId4,
                    Content        = "message has one reaction",
                    ConversationId = channelId5,
                    RegUserName    = "******",
                    ReactionList   = new List <Reaction>
                    {
                        new Reaction
                        {
                            ReactorId    = userId1.ToString(),
                            ReactorName  = "User1",
                            ReactionType = "Like"
                        }
                    },
                    IsPin = true
                },
                new MessageChat
                {
                    Id                = relatedMessageId1,
                    Content           = "message in channel 1",
                    ConversationId    = channelId1,
                    RegUserName       = "******",
                    RelatedMessagesId = relatedMessageId1,
                },
                new MessageChat
                {
                    Id                = relatedMessageId2,
                    Content           = "message in channel 2",
                    ConversationId    = channelId1,
                    RegUserName       = "******",
                    RelatedMessagesId = relatedMessageId2,
                },
                new MessageChat
                {
                    Id                = relatedMessageId3,
                    Content           = "message in channel 2",
                    ConversationId    = channelId1,
                    RegUserName       = "******",
                    RelatedMessagesId = relatedMessageId2,
                }, new MessageChat
                {
                    Content          = "message in conversation 3: Group 3",
                    ConversationId   = conversation3,
                    RegUserName      = "******",
                    Created          = DateTime.UtcNow,
                    ConversationName = "Group 3"
                },
            });

            context.Notifications.AddRange(new[]
            {
                new Notification
                {
                    Id             = notificationId1,
                    MessageContent = "message 1 @Quan",
                    ConversationId = conversation1.ToString(),
                    MessageId      = messageId1.ToString(),
                    RegUserName    = "******",
                    CreatedBy      = userId1.ToString(),
                    isRead         = false,
                    ToUser         = new User {
                        UserOid = userId2.ToString(), DisplayName = "Quan"
                    },
                    Type = "Mention"
                },
                new Notification
                {
                    Id             = notificationId2,
                    MessageContent = "message 2 @Long",
                    ConversationId = conversation1.ToString(),
                    MessageId      = messageId2.ToString(),
                    CreatedBy      = userId2.ToString(),
                    RegUserName    = "******",
                    isRead         = false,
                    ToUser         = new User {
                        UserOid = userId1.ToString(), DisplayName = "Long"
                    },
                    Type = "Mention"
                },
                new Notification
                {
                    Id             = notificationId3,
                    MessageContent = "message 2 @Quan",
                    ConversationId = conversation1.ToString(),
                    MessageId      = messageId3.ToString(),
                    RegUserName    = "******",
                    CreatedBy      = userId1.ToString(),
                    isRead         = false,
                    ToUser         = new User {
                        UserOid = userId2.ToString(), DisplayName = "Quan"
                    },
                    Type = "Mention"
                },
                new Notification
                {
                    Id             = notificationId4,
                    MessageContent = "@Quan mention",
                    ConversationId = conversation1.ToString(),
                    MessageId      = messageId4.ToString(),
                    RegUserName    = "******",
                    CreatedBy      = userId1.ToString(),
                    isRead         = false,
                    ToUser         = new User {
                        UserOid = userId1.ToString(), DisplayName = "Quan"
                    },
                    Type   = "Mention",
                    TeamId = teamId1.ToString()
                }
            });

            context.Planners.AddRange(new[]
            {
                new Planner()
                {
                    Id      = plannerId1,
                    TeamId  = teamId1,
                    Title   = "Planner 1",
                    Purpose = "Purpose 1",
                    Tags    = new List <Tag>
                    {
                        new Tag()
                        {
                            TagName = "Tag 1"
                        },
                        new Tag()
                        {
                            TagName = "Tag 2"
                        }
                    },
                    Milestones = new List <Milestone>
                    {
                        new Milestone()
                        {
                            Title       = "Milestone 1",
                            Description = "Milestone 1 Description",
                            Date        = DateTime.UtcNow,
                            TaskIds     = new List <Guid>
                            {
                                taskItemId1,
                                Guid.NewGuid(),
                            }
                        },
                        new Milestone()
                        {
                            Title       = "Milestone 2",
                            Description = "Milestone 2 Description",
                            Date        = DateTime.UtcNow,
                        }
                    }
                },
                new Planner()
                {
                    Id      = plannerId2,
                    TeamId  = teamId1,
                    Title   = "Planner 2",
                    Purpose = "Purpose 2",
                    Tags    = new List <Tag>
                    {
                        new Tag()
                        {
                            TagName = "Tag 2"
                        },
                        new Tag()
                        {
                            TagName = "Tag 3"
                        }
                    }
                },
                new Planner()
                {
                    Id      = plannerId3,
                    TeamId  = teamId2,
                    Title   = "Planner 3",
                    Purpose = "Purpose 3",
                    Tags    = new List <Tag>
                    {
                        new Tag()
                        {
                            TagName = "Tag 3"
                        },
                        new Tag()
                        {
                            TagName = "Tag 1"
                        }
                    }
                }
            });

            context.SaveChanges();
        }
示例#4
0
        public static void InitializeDbForTests(ColabSpaceDbContext context)
        {
            string loginUserId  = "020cdee0-8ecd-408a-b662-cd4d9cdf0100";
            string teamId       = "ffa8a3e7-50ab-4b10-8e49-96c9f837169d";
            string loginUserId2 = "9c7ff9c5-90bd-4207-9dff-01da2ceece21";

            context.Teams.AddRange(
                new Team
            {
                Id          = new Guid("197d0438-e04b-453d-b5de-eca05960c6ae"),
                Name        = "Team 1",
                Description = "Des1",
                Users       = new List <User>
                {
                    new User()
                    {
                        UserOid     = loginUserId,
                        DisplayName = "TestUser1",
                        TeamRole    = "Leader"
                    }
                }
            },
                new Team
            {
                Id          = new Guid("7567347e-0580-4807-97f1-8edad42c9758"),
                Name        = "Team 2",
                Description = "Des2",
                Users       = new List <User>
                {
                    new User()
                    {
                        UserOid     = loginUserId,
                        DisplayName = "TestUser1",
                        TeamRole    = "Leader"
                    }
                }
            },
                new Team
            {
                Id          = Guid.NewGuid(),
                Name        = "Team 3",
                Description = "Des3",
                Users       = new List <User>
                {
                    new User()
                    {
                        UserOid     = loginUserId,
                        DisplayName = "TestUser1",
                        TeamRole    = "Leader"
                    }
                }
            },
                new Team
            {
                Id          = Guid.Parse("66edb7c7-11bf-40a5-94ab-75a3364fef61"),
                Name        = "Team 4",
                Description = "Des4",
                Users       = new List <User>
                {
                    new User()
                    {
                        UserOid     = Guid.NewGuid().ToString(),
                        DisplayName = "TestUser1",
                        TeamRole    = "Leader"
                    }, new User()
                    {
                        UserOid     = "66edb7c7-11bf-40a5-94ab-75a3364fef60",
                        DisplayName = "TestUser2",
                        TeamRole    = "Member"
                    }
                }
            },
                new Team
            {
                Id          = Guid.Parse("de14a885-71d4-4da0-bb17-048d74d33adc"),
                Name        = "Team 5",
                Description = "Des5",
                Users       = new List <User>
                {
                    new User()
                    {
                        UserOid     = Guid.NewGuid().ToString(),
                        DisplayName = "TestUser ",
                        TeamRole    = "Leader"
                    },
                    new User()
                    {
                        UserOid     = loginUserId2,
                        DisplayName = "TestUser123 ",
                        TeamRole    = "member"
                    }
                }
            }
                );
            context.TaskItems.AddRange(
                new TaskItem
            {
                Id          = new Guid("197d0438-e04b-453d-b5de-eca05960c6ae"),
                Name        = "Task 1",
                Description = "Des1",
                CreatedBy   = new User()
                {
                    UserOid = loginUserId, DisplayName = "TestUser1"
                },
                Status = 1,
                TeamId = new Guid("197d0438-e04b-453d-b5de-eca05960c6ae"),
                IsPin  = true
            },
                new TaskItem
            {
                Id          = new Guid("de14a885-71d4-4da0-bb17-048d74d33ada"),
                Name        = "Task 2",
                Description = "Des2",
                CreatedBy   = new User()
                {
                    UserOid = loginUserId, DisplayName = "TestUser1"
                },
                Status = 1,
                TeamId = new Guid("197d0438-e04b-453d-b5de-eca05960c6ae"),
                IsPin  = true
            },
                new TaskItem
            {
                Id          = Guid.NewGuid(),
                Name        = "Task 3",
                Description = "Des3",
                CreatedBy   = new User()
                {
                    UserOid = loginUserId, DisplayName = "TestUser1"
                },
                Status = 1,
                TeamId = Guid.NewGuid(),
            },
                new TaskItem
            {
                Id          = Guid.Parse("de14a885-71d4-4da0-bb17-048d74d33adb"),
                Name        = "Task 4",
                Description = "Des4",
                CreatedBy   = new User()
                {
                    UserOid = loginUserId, DisplayName = "TestUser1"
                },
                Status = 1,
                TeamId = Guid.NewGuid(),
                IsPin  = false
            }
                );

            //context.HelpItems.AddRange(
            //    new HelpItem()
            //    {
            //        Id = new Guid("7B41389E-7C41-4594-8AF7-06F01D21F973"),
            //        Name = "Topic",
            //        Description = string.Empty,
            //        Content = new AttachFile()
            //        {
            //            FileName = "test.a",
            //            FileSize = 10,
            //            BlobStorageUrl = null,
            //            FileStorageName = "test.b",
            //        },
            //    }
            //);

            context.Conversations.AddRange(
                new Conversation
            {
                Name     = string.Empty,
                isPublic = false,
                Members  = new List <User>
                {
                    new User
                    {
                        UserOid     = loginUserId,
                        DisplayName = "TestUser1"
                    },
                    new User
                    {
                        UserOid     = Guid.NewGuid().ToString(),
                        DisplayName = "TestUser2"
                    }
                },
                Type   = "pair",
                TeamId = null,
                Id     = new Guid("b73477a4-f61d-46fa-873c-7d71c01dfbdf")
            }, new Conversation
            {
                Name     = string.Empty,
                isPublic = false,
                Members  = new List <User>
                {
                    new User
                    {
                        UserOid     = loginUserId,
                        DisplayName = "TestUser1"
                    },
                    new User
                    {
                        UserOid     = "9a1709db-fddf-4f91-8046-e3bc92316bab",
                        DisplayName = "TestUser2"
                    }
                },
                Type   = "pair",
                TeamId = null,
                Id     = Guid.NewGuid()
            },
                new Conversation
            {
                Name     = string.Empty,
                isPublic = false,
                Members  = new List <User>
                {
                    new User
                    {
                        UserOid     = loginUserId,
                        DisplayName = "TestUser1"
                    },
                    new User
                    {
                        UserOid     = loginUserId2,
                        DisplayName = "TestUser3"
                    }
                },
                Type   = "pair",
                TeamId = null,
                Id     = new Guid("b73477a4-f61d-46fa-873c-7d71c01dfbd2")
            },
                new Conversation
            {
                Name     = string.Empty,
                isPublic = false,
                Members  = new List <User>
                {
                    new User
                    {
                        UserOid     = loginUserId,
                        DisplayName = "TestUser1"
                    },
                    new User
                    {
                        UserOid     = loginUserId2,
                        DisplayName = "TestUser3"
                    },
                    new User
                    {
                        UserOid     = Guid.NewGuid().ToString(),
                        DisplayName = Guid.NewGuid().ToString()
                    }
                },
                Type   = "group",
                TeamId = null,
                Id     = new Guid("dcdb9146-32e5-4cc3-ad1c-d10e05745f02")
            },
                new Conversation
            {
                Name     = "Team channel 1",
                isPublic = false,
                Members  = new List <User>
                {
                    new User
                    {
                        UserOid     = loginUserId,
                        DisplayName = "TestUser1-2"
                    },
                    new User
                    {
                        UserOid     = loginUserId2,
                        DisplayName = "TestUser3"
                    },
                    new User
                    {
                        UserOid     = Guid.NewGuid().ToString(),
                        DisplayName = Guid.NewGuid().ToString()
                    }
                },
                Type   = "channel",
                TeamId = teamId,
                Id     = new Guid("dcdb9146-32e5-4cc3-ad1c-d10e05745f05")
            }
                );

            context.Notifications.AddRange(new[] {
                new Notification()
                {
                    MessageContent = "message 2 @USER2",
                    ConversationId = Guid.NewGuid().ToString(),
                    MessageId      = Guid.NewGuid().ToString(),
                    CreatedBy      = Guid.NewGuid().ToString(),
                    RegUserName    = "******",
                    isRead         = false,
                    ToUser         = new User {
                        UserOid = new Guid("66edb7c7-11bf-40a5-94ab-75a3364fef60").ToString(), DisplayName = "USER2"
                    },
                    Type   = "Mention",
                    TeamId = "66edb7c7-11bf-40a5-94ab-75a3364fef61"
                }
            });

            context.MessageChats.AddRange(
                new MessageChat
            {
                Id             = new Guid("b73477a4-f61d-46fa-873c-7d71c01dfbdf"),
                ConversationId = new Guid("b73477a4-f61d-46fa-873c-7d71c01dfbdf"),
                Content        = "abc",
                RegUserName    = "******",
                Created        = DateTime.UtcNow
            },
                new MessageChat
            {
                Id                = new Guid("96149786-a9f7-4b6a-a932-5ddb15a84d1a"),
                ConversationId    = new Guid("b73477a4-f61d-46fa-873c-7d71c01dfbdf"),
                Content           = "abc",
                RegUserName       = "******",
                RelatedMessagesId = new Guid("b73477a4-f61d-46fa-873c-7d71c01dfbdf"),
                RelatedTaskId     = new Guid("197d0438-e04b-453d-b5de-eca05960c6ae"),
                Created           = DateTime.UtcNow.AddDays(1)
            },
                new MessageChat
            {
                Id                = new Guid("a9dc2523-a426-4d4a-9d64-0f3d440ae989"),
                ConversationId    = new Guid("b73477a4-f61d-46fa-873c-7d71c01dfbd2"),
                Content           = "abc",
                RegUserName       = "******",
                RelatedMessagesId = new Guid("b73477a4-f61d-46fa-873c-7d71c01dfbdf"),
                RelatedTaskId     = new Guid("197d0438-e04b-453d-b5de-eca05960c6ae"),
                Created           = DateTime.UtcNow
            }
                );


            context.Planners.AddRange(new[]
            {
                new Planner()
                {
                    Id      = new Guid("cbb85a08-ed54-4924-9135-e1f723a2ba6b"),
                    TeamId  = new Guid("197d0438-e04b-453d-b5de-eca05960c6ae"),
                    Title   = "Planner 1",
                    Purpose = "Purpose 1",
                    Tags    = new List <Tag>
                    {
                        new Tag()
                        {
                            TagName = "Tag 1"
                        },
                        new Tag()
                        {
                            TagName = "Tag 2"
                        }
                    },
                    Milestones = new List <Milestone>
                    {
                        new Milestone()
                        {
                            Title       = "Milestone 1",
                            Description = "Milestone 1 Description",
                            Date        = DateTime.UtcNow,
                            TaskIds     = new List <Guid>
                            {
                                new Guid("197d0438-e04b-453d-b5de-eca05960c6ae"),
                                new Guid("DE14A885-71D4-4DA0-BB17-048D74D33ADA"),
                            }
                        },
                        new Milestone()
                        {
                            Title       = "Milestone 2",
                            Description = "Milestone 2 Description",
                            Date        = DateTime.UtcNow,
                        }
                    }
                },
                new Planner()
                {
                    Id      = new Guid("5F6FC408-D2A5-4BA2-A73E-A4F9125A26B1"),
                    TeamId  = new Guid("197d0438-e04b-453d-b5de-eca05960c6ae"),
                    Title   = "Planner 2",
                    Purpose = "Purpose 2",
                    Tags    = new List <Tag>
                    {
                        new Tag()
                        {
                            TagName = "Tag 2"
                        },
                        new Tag()
                        {
                            TagName = "Tag 3"
                        }
                    }
                },
                new Planner()
                {
                    Id      = new Guid("744C1463-0BEB-48AD-AB79-865B5183651F"),
                    TeamId  = new Guid("7567347E-0580-4807-97F1-8EDAD42C9758"),
                    Title   = "Planner 3",
                    Purpose = "Purpose 3",
                    Tags    = new List <Tag>
                    {
                        new Tag()
                        {
                            TagName = "Tag 3"
                        },
                        new Tag()
                        {
                            TagName = "Tag 1"
                        }
                    }
                }
            });
            context.SaveChanges();
        }